Git Product home page Git Product logo

powernix's People

Contributors

alaurie avatar joshcorr avatar startautomating avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

joshcorr

powernix's Issues

Shebangs should be easy to create

Shebangs are used throughout Linux, and would be great to create as automatically as possible.

It should be easy to create a Shebang based off of a PowerShell script or function, and also easy to create a shebang based off of script files written in another language.

Override more commands

ugit has been a great approach for console commands.

PipeScript inheritance makes this fairly simple to implement.

PowerNix should start overriding more unix commands and parsing output where possible.

Get-NixDistro

Get-NixDistro should give information about the current Linux distro.

Get-NixLog issues parsing date

Looks like there is an issue with parsing the non standard date time

MethodInvocationException: /home/user/.local/share/powershell/Modules/PowerNix/0.0.5/Get-NixLog.ps1:150
Line |
 150 |                          [PSCustomObject][ordered]@{
     |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "ParseExact" with "3" argument(s): "String 'Sep  2 00:00:33' was not recognized as a
     | valid DateTime."
     ```

Get-NixMount does not display correct

Get-NixMount returns two empty properties: TargetPath and SourceName.

Get-NixMount | Select * reveals that these should be MountPoint and Device (respectively)

Commands that use Get-Content should expose -Wait, -Tail, -ReadCount, and -TotalCount

If a given command is based off of Get-Content (and the file content is likely to change), it should proxy the following parameters from Get-Content:

  • ReadCount
  • Tail
  • TotalCount
  • Wait

Additionally, any code that converts output to objects should "stream" output, rather than assign it to a temporary variable or an array.

Implementing these changes will increase the flexibility of the commands.

Get-NixLog

We should have a command to Get-NixLogs.

It should handle several different log formats, and use the first line / name of the log to detect which format to use.

It should also be "smart aliased", so that calling it with a well-known log name will get results from that log (e.g. sys.log)

It would be nice to provide some filtering parameters, though these should probably be limited.

Get-NixLog not working in v0.0.4

Get-NixLog does not seem to work in the v0.0.4.

PS /home/testuser> Get-InstalledModule PowerNix | select Version
0.0.4


PS /home/testuser> $PSVersionTable | select PSVersion
7.1.4


PS /home/testuser> Get-NixDistro
Ubuntu 20.04.3 LTS Ubuntu ubuntu debian  20.04.3 LTS (Focal Fossa)


PS /home/testuser> Get-NixLog -LogFilePath '/var/log/syslog'    
Write-Error: /home/testuser/.local/share/powershell/Modules/PowerNix/0.0.4/Get-NixLog.ps1:168
Line |
 168 |              & { process {
     |              ~~~~~~~~~~~~~
     | Unable to parse log

Snippet from /var/log/syslog:

Aug 24 00:00:01 linux-test systemd[1]: logrotate.service: Succeeded.
Aug 24 00:00:01 linux-test systemd[1]: Finished Rotate log files.
Aug 24 00:00:01 linux-test systemd[1]: man-db.service: Succeeded.
Aug 24 00:00:01 linux-test systemd[1]: Finished Daily man-db regeneration.
Aug 24 00:00:05 linux-test multipathd[692]: sda: add missing path
Aug 24 00:00:05 linux-test multipathd[692]: sda: failed to get udev uid: Invalid argument
Aug 24 00:00:05 linux-test multipathd[692]: sda: failed to get sysfs uid: Invalid argument
Aug 24 00:00:05 linux-test multipathd[692]: sda: failed to get sgio uid: No such file or directory
Aug 24 00:00:10 linux-test multipathd[692]: sda: add missing path
Aug 24 00:00:10 linux-test multipathd[692]: sda: failed to get udev uid: Invalid argument

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.