Restart-Computer -Wait in Workflow doesn't wait - by AndyCadley

Status : 

 


1
0
Sign in
to vote
ID 842380 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 3/28/2014 3:54:08 AM
Access Restriction Public

Description

When Restart-Computer -Wait is used in a Workflow task, Powershell does not wait and continues to run the remainder of the workflow. If the PC reboots before this has completed, a resumable job gets created as expected but this is obviously not the intended behaviour and can cause issues when the subsequent workflow steps are expecting the reboot to have successfully completed. 

Tested on a evaluation version of Windows Server 2012, with the following output from $PSVersionTable:

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      3.0                                                                                     
WSManStackVersion              3.0                                                                                     
SerializationVersion           1.1.0.1                                                                                 
CLRVersion                     4.0.30319.18408                                                                         
BuildVersion                   6.2.9200.16384                                                                          
PSCompatibleVersions           {1.0, 2.0, 3.0}                                                                         
PSRemotingProtocolVersion      2.2                                                                                     
Sign in to post a comment.