3 ms·
My use of non-Windows PowerShell is mainly used to sanity checking scripts that are destined to run on Windows boxes, where I want to quickly check the semantic
by 22c 3y ago
My use of non-Windows PowerShell is mainly used to sanity checking scripts that are destined to run on Windows boxes, where I want to quickly check the semantics of certain OS agnostics behaviour without firing up a remote desktop to a Windows VM.
Running things like:
Get-Item -Path ./ | ConvertTo-Json
$my_bytes = @(Get-Content -AsByteStream -TotalCount 16 /dev/urandom)
work exactly as you'd expect them to on *nix. I don't have procfs on my system but I imagine that would work just the same as interacting with any other file.
PSDrive works the same as you would expect, including things like reading/manipulating ENV via the "Env:" PSDrive.
I can't think of anything off the top of my head that you can do in Bash that you couldn't do in PowerShell.