- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use -For parameter in Restart-Computer cmdlet in PowerShell?
In the –Wait parameter 3 main checks are validated − PowerShell, WMI, and WINRM connectivity. So whenever you specify the –Wait parameter, you have to wait until all three checks pass, however, if any of the checks fail then script freezes and can not further execute. If you know which specific check you want to perform then you can specify that value with the –For parameter as shown below.
Here, for the example, we will run a single WMI check for the remote server.
Restart-Computer Test1-Win2k12 -Wait -For Wmi -Force
-For parameter must be used with –Wait parameter. Here, again if something goes wrong while validation, it may take longer and longer time for the validation to pass or fail. To prevent the deadlock situation, you can use the -Timeout parameter.
- Related Articles
- How to use –Wait parameter in Restart-Computer cmdlet in PowerShell?
- How to use –Timeout parameter in Restart-Computer cmdlet in PowerShell?
- How to use Group-Object cmdlet in PowerShell?
- How to use ForEach-Object Parallel cmdlet in PowerShell?
- How to use an alias() for the parameter in PowerShell?
- How to use the ErrorAction parameter in PowerShell?
- How to use the -recursive parameter in Get-ChildItem using PowerShell?
- What is the use of the Get-Error cmdlet in PowerShell?
- How to get supported parameters of the cmdlet in PowerShell?
- How to restart a remote system using PowerShell?
- What is Get-ChildItem cmdlet in PowerShell?
- How to restart the Azure VM using Azure CLI in PowerShell?
- What is the use of Passthru parameter in Stop-Process in PowerShell?
- What is the use of -Force parameter in Get-ChildItem in PowerShell?
- How to use PowerShell as a Calculator? Or How to use PowerShell for arithmetic operations?

Advertisements