Restart-Computer
注意再起動(リモート可)
Restart-Computer -ComputerName <host> -Force
ローカル/リモートPCを再起動。-Waitで復帰まで待機できパッチ適用の自動化に便利。-Forceはセッション強制終了。
実行例
Restart-Computer -ComputerName srv01 -Wait -For PowerShell復帰を待って次の処理へ
書式
Restart-Computer [-ComputerName host] [-Force] [-Wait]
実行前の注意
-Forceは未保存作業を失わせる。
関連コマンド
- shutdown再起動・シャットダウン
- Invoke-Commandリモートで一括実行