- http://technet.microsoft.com/zh-cn/scriptcenter/powershell.aspx
- $Host.Version
- 1..15 | % {Write-Host -ForegroundColor $_ "Hello"}
- Get-Process | Stop-Process -WhatIf
- Get-Process | Stop-Process -Confirm
- Get-EventLog -LogName application -Newest 1
- Get-Verb
- Get-Variable
- Get-Command
- Get-Help
- Update-Help
- Get-Help Get-Process -Examples
- Dir,Cls,Md,Rd,Ls,Get-Process,Get-Service,Get-EventLog,Get-Lost?,Get-Help
- cat,可以用文本文件作为输入参数
- Get-Process notepad | Stop-Process
- Get-History(h), r 23再次执行第23条历史指令
- 重定向:>,>>
- 读文件:Get-Content(gc,cat,type)
- 添加内容:Add-Content(ac)
- 删除文件:Remove-Item(del,erase)
- dir | where { $_.Mode -match '^d' }
- Get-ChildItem . | where { $_.LastWriteTime -gt [datetime]"3/3/2013" }
- New-Item Alias:myalias -Value gps
- New-Item function:myfunction -Value{Get-Process -name $input}, "svchost" | myfunction
- New-Item env:myenv -Value "myenv", Get-Item Env:\myenv
- New-Item variable:myvar -Value "myVar", Get-Item Variable:\myvar
- Variable:Clear-Variable,Get-Variable,New-Variable,Remove-Variable,Set-Variable
- Alias: Expor-Alias,Get-Alias,Import-Alias,New-Alias,Set-Alias
- Get-Command -Noun Variable,Get-Variable $ | Format-List
- Get-Command -Noun alias