3 ms·
By "got this right", the parent poster probably meant tab completion. You get that for free when writing a script or function, as well as basic syntax documenta
by fainpul 1y ago
By "got this right", the parent poster probably meant tab completion. You get that for free when writing a script or function, as well as basic syntax documentation. Both can be improved gradually by adding hints / comments in your script.
If you are bothered by the verbose `Verb-Noun` structure of commands, those are mostly used in scripts (and you never type them fully, you use tab-completion of course). On the commandline you use aliases for many of them.
For example listing files and directories created in the last 10 days:
ls | ? CreationTime -ge (Get-Date).AddDays(-10) | ft name, size
All the long words are tab completed (CreationTime, Get-Date, AddDays).
The fully verbose syntax you might write in a script looks a bit uglier:
Get-ChildItem | Where-Object CreationTime -ge (Get-Date).AddDays(-10) | Format-Table Name, Size
Also PowerShell is NOT case-sensitive, even though many people seem to think so.