startautomating / powernix Goto Github PK
View Code? Open in Web Editor NEWLinux Tools for PowerShell People.
License: MIT License
Linux Tools for PowerShell People.
License: MIT License
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.
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.
There's stuff only Linux can do well, and stuff only PowerShell can do well.
We should find the overlap and build the best examples we can.
Get-NixDistro should give information about the current Linux distro.
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 returns two empty properties: TargetPath and SourceName.
Get-NixMount | Select * reveals that these should be MountPoint and Device (respectively)
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:
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.
This should likely use the options _netdev and x-systemd.after=network-online.target
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.