cmdlets Another name for , It's good for using traditional cmd The way Or use bash The way people work , More convenient use of more frequent commands .

Here is from Built in aliases obtained from aliases .

PS C:\> Get-Alias *>>a.txt
PS C:\> Get-Content .\a.txt

CommandType Name ModuleName
----------- ---- ----------
Alias % -> ForEach-Object
Alias ? -> Where-Object
Alias ac -> Add-Content
Alias asnp -> Add-PSSnapin
Alias cat -> Get-Content
Alias cd -> Set-Location
Alias chdir -> Set-Location
Alias clc -> Clear-Content
Alias clear -> Clear-Host
Alias clhy -> Clear-History
Alias cli -> Clear-Item
Alias clp -> Clear-ItemProperty
Alias cls -> Clear-Host
Alias clv -> Clear-Variable
Alias cnsn -> Connect-PSSession
Alias compare -> Compare-Object
Alias copy -> Copy-Item
Alias cp -> Copy-Item
Alias cpi -> Copy-Item
Alias cpp -> Copy-ItemProperty
Alias curl -> Invoke-WebRequest
Alias cvpa -> Convert-Path
Alias dbp -> Disable-PSBreakpoint
Alias del -> Remove-Item
Alias diff -> Compare-Object
Alias dir -> Get-ChildItem
Alias dnsn -> Disconnect-PSSession
Alias ebp -> Enable-PSBreakpoint
Alias echo -> Write-Output
Alias epal -> Export-Alias
Alias epcsv -> Export-Csv
Alias epsn -> Export-PSSession
Alias erase -> Remove-Item
Alias etsn -> Enter-PSSession
Alias exsn -> Exit-PSSession
Alias fc -> Format-Custom
Alias fl -> Format-List
Alias foreach -> ForEach-Object
Alias ft -> Format-Table
Alias fw -> Format-Wide
Alias gal -> Get-Alias
Alias gbp -> Get-PSBreakpoint
Alias gc -> Get-Content
Alias gci -> Get-ChildItem
Alias gcm -> Get-Command
Alias gcs -> Get-PSCallStack
Alias gdr -> Get-PSDrive
Alias ghy -> Get-History
Alias gi -> Get-Item
Alias gjb -> Get-Job
Alias gl -> Get-Location
Alias gm -> Get-Member
Alias gmo -> Get-Module
Alias gp -> Get-ItemProperty
Alias gps -> Get-Process
Alias group -> Group-Object
Alias gsn -> Get-PSSession
Alias gsnp -> Get-PSSnapin
Alias gsv -> Get-Service
Alias gu -> Get-Unique
Alias gv -> Get-Variable
Alias gwmi -> Get-WmiObject
Alias h -> Get-History
Alias history -> Get-History
Alias icm -> Invoke-Command
Alias iex -> Invoke-Expression
Alias ihy -> Invoke-History
Alias ii -> Invoke-Item
Alias ipal -> Import-Alias
Alias ipcsv -> Import-Csv
Alias ipmo -> Import-Module
Alias ipsn -> Import-PSSession
Alias irm -> Invoke-RestMethod
Alias ise -> powershell_ise.exe
Alias iwmi -> Invoke-WmiMethod
Alias iwr -> Invoke-WebRequest
Alias kill -> Stop-Process
Alias lp -> Out-Printer
Alias ls -> Get-ChildItem
Alias man -> help
Alias md -> mkdir
Alias measure -> Measure-Object
Alias mi -> Move-Item
Alias mount -> New-PSDrive
Alias move -> Move-Item
Alias mp -> Move-ItemProperty
Alias mv -> Move-Item
Alias nal -> New-Alias
Alias ndr -> New-PSDrive
Alias ni -> New-Item
Alias nmo -> New-Module
Alias npssc -> New-PSSessionConfigurationFile
Alias nsn -> New-PSSession
Alias nv -> New-Variable
Alias ogv -> Out-GridView
Alias oh -> Out-Host
Alias popd -> Pop-Location
Alias ps -> Get-Process
Alias pushd -> Push-Location
Alias pwd -> Get-Location
Alias r -> Invoke-History
Alias rbp -> Remove-PSBreakpoint
Alias rcjb -> Receive-Job
Alias rcsn -> Receive-PSSession
Alias rd -> Remove-Item
Alias rdr -> Remove-PSDrive
Alias ren -> Rename-Item
Alias ri -> Remove-Item
Alias rjb -> Remove-Job
Alias rm -> Remove-Item
Alias rmdir -> Remove-Item
Alias rmo -> Remove-Module
Alias rni -> Rename-Item
Alias rnp -> Rename-ItemProperty
Alias rp -> Remove-ItemProperty
Alias rsn -> Remove-PSSession
Alias rsnp -> Remove-PSSnapin
Alias rujb -> Resume-Job
Alias rv -> Remove-Variable
Alias rvpa -> Resolve-Path
Alias rwmi -> Remove-WmiObject
Alias sajb -> Start-Job
Alias sal -> Set-Alias
Alias saps -> Start-Process
Alias sasv -> Start-Service
Alias sbp -> Set-PSBreakpoint
Alias sc -> Set-Content
Alias select -> Select-Object
Alias set -> Set-Variable
Alias shcm -> Show-Command
Alias si -> Set-Item
Alias sl -> Set-Location
Alias sleep -> Start-Sleep
Alias sls -> Select-String
Alias sort -> Sort-Object
Alias sp -> Set-ItemProperty
Alias spjb -> Stop-Job
Alias spps -> Stop-Process
Alias spsv -> Stop-Service
Alias start -> Start-Process
Alias sujb -> Suspend-Job
Alias sv -> Set-Variable
Alias swmi -> Set-WmiInstance
Alias tee -> Tee-Object
Alias trcm -> Trace-Command
Alias type -> Get-Content
Alias wget -> Invoke-WebRequest
Alias where -> Where-Object
Alias wjb -> Wait-Job
Alias write -> Write-Output

You can also customize aliases : such as  linux Next commonly used touch command . create a file .

stay pw in yes  new-item Alias ni. Let's redefine a touch . Parameters item-type=file Of

In PowerShell you can create a similar Touch function as such:

function touch {set-content -Path ($args[0]) -Value ($null)}


touch myfile.txt

Delete your own alias

Aliases don't need to be deleted , Custom alias in powershell It will be cleared automatically when you exit . But rest assured ,powershell Built in alias ( Such as ls,dir,fl etc. ) It won't clear . If you have to delete the alias manually . Please use

PS C:\PS> del alias:Edit

Save your alias

have access to Export-Alias Export alias to file , Pass when necessary Import-Alias Import . But there may be exceptions when importing , Indicates that the alias already exists and cannot be imported :

PS C:\PS> Import-Alias alias.ps1
Import-Alias : Alias not allowed because an alias with the name 'ac' already exists.
At line:1 char:13
+ Import-Alias <<<< alias.ps1
+ CategoryInfo : ResourceExists: (ac:String) [Import-Alias], SessionStateException
+ FullyQualifiedErrorId : AliasAlreadyExists,Microsoft.PowerShell.Commands.ImportAliasCommand

You can use Force Force import .

PS C:\PS> Export-Alias alias.ps1
PS C:\PS> Import-Alias -Force alias.ps1

About PowerShell More related articles about the alias of the command in

  1. by cmd To add an alias to a command in , To solve the problem java: error : code GBK Unmapped characters of (0xAF)

    Use sublineText3 Write the java Code , adopt cmd javac compile Tips error : code GBK Unmapped characters of resolvent Use javac -encoding UTF-8 result ...

  2. stay CMD Command line and PowerShell To achieve copy and paste function

    stay CMD Command line and PowerShell To achieve copy and paste function         Often use the command line or PowerShell I'm sure that's what happens to my friends : Pasting text is very easy, Right click -- Just choose paste , But if you want to copy the command ...

  3. 【 turn 】PowerShell introduction ( Two ):PowerShell yes Cmd An enhanced version of the command line ?

    Transferred to : PowerShell Is it an enhanced version of the command line ?Power ...

  4. powershell Medium cmdlet command

    Add-Computer Add computers to a domain or workgroup . Add-Content Add content to the specified item , Add words to the file . Add-History Append an entry to the session history . Add-Member towards W ...

  5. powershell Commonly used cmd,unix command (get-alias)

    powershell Commonly used cmd,unix command (get-alias) Get-Content Alias cat -> Get-Content Alias gc -> Get-Conte ...

  6. PowerShell_ Zero foundation self study course _5_ Customize PowerShell Environment and Powershell Basic concepts in

    PowerShell_ Zero foundation self study course _5_ Customize PowerShell Environment and Powershell Basic concepts in As far as I know ,windows Under the cmd shell In addition to the ability to modify the system parameters to the environment variables ...

  7. powershell operation sharepoint Command set

    open SharePoint 2013 Management Shell, and then run as administrator. Execute the following command 1. add to wsp And installation Add-SPSolution - ...

  8. stay PowerShell Use in curl(Invoke-WebRequest)

    Preface Accustomed to the windows It's hard to switch to the command line , Even made a fortune from the command line git There are also various interfaces emerging tool. However, the command line is really much faster than the interface , If you are a yard farmer . situation: Receiving demand analysis bug, Need to visit ...

  9. powershell Script , Command line parameters pass values , And binding variables

    This is a tip article , So the article is not long . But the only one , It's very important . I searched , No one really sends it powershell How to [ Command line Parameters binding ], So I decided to blog . The search keywords are as follows : powershell Command line Parameters ...

Random recommendation

  1. Codevs Pile practice

    Codevs Pile practice gold :2830.2879.2995.3110 diamond :1052.1063.1245.1246.2057.2573.3377 The master :1021.1765.2069.2913.3032

  2. Linux Take advantage of CGroup control CPU、 Memory and IO Operation record of

    CGroup The introduction of the system and its subsystems will not be repeated here , You can refer to :Linux Next CGroup Use the instructions to sort out the nonsense , Here's a record of using CGroup control CPU. Memory and IO Operation record of : libcgroup The tool is installed here to ...

  3. Read xml file Get the data information stored in it

    Establish a stored procedure to return the data to be read to form a result set : CREATE PROC dbo.getValuesFromXmlByPath@fileName NVARCHAR(128)asDECLARE @T XM ...

  4. nodejs hello world ( No response to call file execution )

    I learned it today node.js , Take a look at hello world Writing . 1. First installation node.js The driver file for . 2. a: Install well node after , stay CMD Window type nod ...

  5. javascript Study (9)——[ Design patterns ] Single case

    The singleton pattern , I believe you are not unfamiliar with this , Let's talk about javascript Several common design patterns in : (1). Ordinary monomers (2). Powerful monomers with local variables (3). Inert monomers (4). Branching monomer Let's introduce them one by one ...

  6. Netty Yes Protocol Buffer Support for ( 7、 ... and )

    Netty Yes Protocol Buffer Support for ( 7、 ... and ) One . brief introduction In the last blog post, the author has introduced google Of Protocol Buffer Use , Then the author of this paper will begin to introduce netty Yes Protocol B ...

  7. Hands teach you how to use it gracefully Aop Record the complexity with parameters Web Interface log

    Preface not long ago , Because of demand , You need to implement an operation log . After almost every interface is called , Record a specific log linked to this parameter to the database . for instance , For example, forbidden operation , It needs to be recorded in the log because of what's forbidden , The forbidden man's id And all kinds of ...

  8. linux A key to install lnmp Environmental Science

    ①, Run after login :screen -S lnmp ②. If you are prompted screen: command not found There is no command to execute :     yum install wget  ③.  Carry out orders :wget ...

  9. __ATTRIBUTE__ Know how much ?

    GNU C  One of the main features of this project is __attribute__  Mechanism .__attribute__  You can set function properties (Function Attribute ). Variable properties (Variable Attribute ) and ...

  10. Common mistakes in development : Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar

    SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackO ...