PowerShell常用指令
| 
Get-Command | 
查看所有命令 | 
| 
Get-Command | Format-List 
Get-Command | FL | 
查看所有命令的詳細說明 | 
| 
Get-Command | Where-Object { $_.name
  -like "set*" } 
Get-Command | ? { $_.name -like
  "set*" } | 
查看含有set開頭的命令 | 
| 
Get-Service 
gsv | 
查看所有已安裝的服務清單 | 
| 
Get-Process 
gps | 
查看目前的執行緒清單 | 
| 
Get-Alias | 
查看所有可用的別名 | 
| 
1..254| ForEach-Object -Process
  {Get-WmiObject -Class Win32_PingStatus -Filter
  ("Address='192.168.1." + $_ + "'") -ComputerName .} |
  Select-Object -Property Address,ResponseTime,StatusCode | 
Ping指定的IP網段範圍 | 
where 陳述式支援下列運算子: 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
 
  
  
 
| 
-eq | 
等於 | 
| 
-ne  | 
不等於 | 
| 
-lt  | 
小於 | 
| 
-le | 
小於或等於 | 
| 
-gt | 
大於 | 
| 
-ge  | 
大於或等於 | 
| 
-like | 
使用萬用字元規則比較字串 | 
| 
-notlike | 
使用萬用字元規則比較字串 | 
| 
-contains | 
包含 | 
| 
-notcontains | 
不包含 | 
| 
-replace | 
取代字串 | 
 
