PowerShell Use the Get-alias command to get the cmdlet alias example _powershell

Source: Internet
Author: User
Tags aliases

In PowerShell, in order to be compatible with the original cmd command, aliases are specifically set for many cmdlet. These aliases have the same name as the cmd command, but they represent a cmdlet in a PowerShell. Like dir, this cmd command, which lists subfolders and files in a directory, has a Get-childitem cmdlet in PowerShell, and it also lists subfolders and files in a directory. So Microsoft gave Get-childitem a name called Dir.

In PowerShell, using the Get-alias cmdlet, you can list all aliases and their corresponding cmdlet.

Copy Code code as follows:

PS c:\users\zhanghong> Get-alias

CommandType Name Definition
-----------     ----                            ----------
Alias% Foreach-object
The Alias? Where-object
Alias Cat Get-content
Alias CD Set-location
Alias chdir set-location
Alias Clear Clear-host
Alias Clhy Clear-history
Alias CLS Clear-host
Alias CLV clear-variable
Alias Compare Compare-object
Alias Copy Copy-item
Alias CP Copy-item
Alias CPI Copy-item
......


Small series here only listed a very small part of everyone interested can go to see.

Have you seen from the above show that this is a few things:

1, the alias can also be a question mark (?), percent semicolon (%) such dongdong
2. A cmdlet can have multiple aliases
3, some aliases are windows under the CMD command name, and some are under the Linux shell command name (it seems Microsoft is really very thoughtful ha)

If someone wants to know how to use the alias, well, I almost forgot the question. Since it's called an alias, it must have replaced the original cmdlet, don't you think?

About the PowerShell of the cmdlet in the alias, small series on the introduction so, hope to beginners have a certain help, thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.