Www
What is PowerShell?
PowerShell can be seen as an upgraded version of CMD (Bat scripting language), a scripting language on the Windows platform. She was
Object-oriented. She is closely related to the. Net FrameWork. Can also be thought of as a bash shell on windows
Why would I want to use PowerShell?
- Because I'm already learning. Net, Learning PowerShell is easier
- CMD is not good enough, PowerShell is more friendly and powerful
- Managing apps on Azure is easy
When to use PowerShell
- Usually write some small script, for the convenience of operation. such as compiling programs, running gulp,copy delete files and so on.
- Operations Windows systems
PowerShell and CMD
In PowerShell, you can continue with the cmd command. PowerShell will load the Cmd.exe when it is initialized
Cmdlets, function, and Scripts1. Concept
The cmdlet is the built-in basic command for PowerShell. Naming is usually a verb + noun. Better remember.
Scripts is the script file that is written.
2. Common Command get-help command
Alias: Help;man;
Usage: Help + command name; (You can use wildcard characters *)
help Get-Command
help Get-Comman*
help *log*#可以使用这种方式来查找命令
help Get-Command-full
help Get-Command-detailed
help Get-Command-examples
#-detailed和-full的区别:
#输出的内容没有区别,但是-full会一次性完全输出。-detailed会根据屏幕的大小输出,然后翻页。
When you use the command Help CD, the following command is output.
Set-Location-LiteralPath<String>[-PassThru][-UseTransaction][<CommonParameters>]
Set-Location[[-Path]<String>][-PassThru][-UseTransaction][<CommonParameters>]
Set-Location[-PassThru][-StackName<String>][-UseTransaction][<CommonParameters>]
- It is important to note that these three results are independent of one another. For example: If you use the-path parameter, then if you want to use other parameters, you can only select-passthru;-usetransaction. Like-literalpath and-stackname, they can't be used.
- [] This represents a common 8 parameter setting, which is available in each Cmd-let command
- Enclosed in brackets, instructions are optional parameters
Get-command
Alias: GCM
Usage: Same as the help command, but only displays information for simple commands
Get-alias alias Command
Alias: Gal
Usage: get-alias-definition command name; get-alias-name alias name
Get-Alias-DefinitionGet-Command#获取Get-Command的别名
Get-Alias-Name ls
#可以使用这种方式来获取命令参数的别名
(get-command get-eventlog |select-ExpandProperty parameters).computername.aliases
Show-command command: Pop up a GUI program to help with the input of the command
Alias: SHCM
Usage: SHCM gal; SHCM Get-help
1-powershell Basic Concepts and usage