Get-CimInstance Win32_Service | ForEach-Object {
[pscustomobject]@{
"名前" = $_.DisplayName
"説明" = $_.Description
"状態" = if ($_.State -eq "Running") { "実行中" } else { "停止" }
"スタートアップの種類" = switch ($_.StartMode) {
"Auto" { "自動" }
"Manual" { "手動" }
"Disabled" { "無効" }
default { $_.StartMode }
}
"ログオン" = $_.StartName
}
} | Export-Csv "C:\services.csv" -NoTypeInformation -Encoding UTF8
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme