Hoe om hulp te krijgen en vind aliassen van commando's in Windows Powershell?
Een commando in Powershell kan een of meerdere alias hebben. Een alias is het commando maar een kortere en meestal afgekort. Sommige aliassen zijn gemaakt om bash commando's overeenkomen.
Get-ChildItem
Deze opdracht geeft de inhoud van de huidige werkdirectory.
Alias: ls, dir
Get-Alias
Om de alias van een commando vinden in Powershell gebruik maken van de Get-Alias opdracht.
Bijvoorbeeld, vind alle aliassen met r beginnen
get-alias r*
De Get-Alias commando zelf heeft een alias gal. The following will do the same thing as above…
gal r*
Get-Alias krijgt ook het volledige gezag staan van een alias
gal ls
uitgangen: ls -> Get-ChildItem
We can also find all the aliases of the specified command with the -Definition parameter. Bijvoorbeeld, let’s find all the aliases of the Get-ChildItem opdracht. We use -d which is short for -Definition
gal -d get-childitem
uitgangen
dir -> Get-ChildItem gci -> Get-ChildItem ls -> Get-ChildItem
Get-Command finds the commands by command name. Get-Command has the alias gcm. So we can do this…
Krijg cmdlets te beginnen met get
gcm -c cmdlet get*
Het bovenstaande is gelijk aan….
Get-Command -CommandType Cmdlet Get*
To get help on any of the aliases or commands, just type help in front of the command. Bijvoorbeeld…
help cp
