Hvordan få hjelp og finne aliaser av kommandoer i Windows Powershell?

En kommando i Powershell kan ha ett eller flere alias. Et alias er kommandoen, men i et kortere, og for det meste forkortet form. Noen aliaser er laget for å matche bash kommandoer.

 

Get-ChildItem

Denne kommandoen viser innholdet i gjeldende arbeidskatalog.
Alias: ls, dir

 

Get-Alias

For å finne alias for en kommando i Powershell bruker Get-Alias kommando.

 

Eksempelvis, finne alle aliaser starter med r
get-alias r*

 

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

 

Get-Alias også får full kontroll over et alias
gal ls
utganger: ls -> Get-ChildItem

 

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

gal -d get-childitem

utganger

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 starter med komme
gcm -c cmdlet get*

 

Den ovennevnte er den 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. Eksempelvis…

help cp