Sådan får du hjælp og finde kaldenavne af kommandoer i Windows PowerShell?

En kommando i Powershell kan have en eller mange alias. Et alias er kommandoen, men i en kortere og for det meste forkortet form. Nogle aliasser er lavet til at matche bash kommandoer.

 

Get-ChildItem

Denne kommando viser indholdet af den aktuelle arbejdsmappe.
Alias: ls, dir

 

Get-Alias

For at finde den alias af en kommando i Powershell bruger Get-Alias kommando.

 

For eksempel, find all the aliases start with r
get-alias r*

 

Den Get-Alias kommando selv har et alias gal. The following will do the same thing as above
gal r*

 

Get-Alias også får fulde kommando et alias
gal ls
Outputs: ls -> Get-ChildItem

 

We can also find all the aliases of the specified command with the -Definition parameter. For eksempel, let’s find all the aliases of the Get-ChildItem kommando. We use -d which is short for -Definition

gal -d get-childitem

Outputs

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
Få cmdlets startende med at komme
gcm -c cmdlet get*

 

Ovenstående er det samme som….
Get-Command -CommandType Cmdlet Get*

To get help on any of the aliases or commands, just type help in front of the command. For eksempel…

help cp