3 ms·
The 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. Bu
by HyperSane 4y ago
The 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.