4 ms·
Even giving an opinion would be something. What's something you like better about PowerShell? I can easily say something I dislike about it: This form `Verb-Lo
by bscphil 4y ago
Even giving an opinion would be something. What's something you like better about PowerShell? I can easily say something I dislike about it:
This form `Verb-LongNoun` for function names used in PS is somewhere between alien and maddening. It's difficult to type, difficult to remember, and isn't an obvious improvement over `lowercasename` which is typical of basically every other shell.
I guess the idea is that you don't have to worry about naming collisions with programs in your path? That's never been an issue for me when writing shell scripts though, not even once.
- vips7L 4y agoYou don’t have to use Verb-LongNoun. PowerShell will fuzzy match as long as it’s not ambiguous. Verb-L might be enough. If you’re in an interactive shell they’re already aliased to shorter forms like “gal” for Get-Alias or “gci” for Get-ChildItem. I’m not OP but things I like about PowerShell: - Objects instead of text - The entire C# std lib is accessible - One tool with the same UX vs several different tools with different UX.
- wruza 4y agoWow, your first paragraph alone is why I’ll never even touch PS.
- HyperSane 4y agoThe mostly consistent Verb-Noun naming convention is a good thing about powershell and isn't an issue due to very good autocompletion is PowerShell editors. But the single best feature of PS is that you pipe structured objects to the next command, instead of raw text that must be parsed, which is prone error. Every command output object can be exported to JSON with ConverTo-JSON. You can export the entire Active Directory as JSON with Get-ADObject -Filter * | ConvertTo-JSON > AD.json Some more examples. Get-ChildItem -Path *.txt | Where-Object {$_.length -gt 10000} | Sort-Object -Property length | Format-Table -Property name, length Get-Item -Path HKLM:\Software\MyCompany | New-ItemProperty -Name NoOfEmployees -Value 8124 Get-Process | Sort-Object -Property handles
- bscphil 4y ago> But the single best feature of PS is that you pipe structured objects to the next command, instead of raw text that must be parsed I agree with that, but other advanced shells (xonsh, elvish, or even fish) also have this feature.
- HyperSane 4y agoI like Powershell's implementation the best.