powershell命令

  • 查看本机安装软件列表
Get-WmiObject -Class win32_product | Select-Object -Property name,version
  • 查看域计算机数量
powershell -c (Get-ADComputer -Filter *).Count  
  • 查看域用户数量
powershell -c (Get-ADUser -Filter *).Count
  • 查看任务列表详情-描述
Get-Process | Select-Object ProcessName, Id, Path, Description
Get-Process | Select-Object ProcessName, Id, Path, Description | Export-Csv -Path "processes.csv" -NoTypeInformation -Encoding UTF8

Get-Process | Select-Object ProcessName, Id, Path, Description | Out-File -FilePath "processes.txt" -Encoding UTF8
  • 查看任务列表-命令行参数
Get-WmiObject Win32_Process | Select-Object ProcessId, Name, ExecutablePath, CommandLine | Export-Csv -Path "processes.csv" -NoTypeInformation -Encoding UTF8