Is there any option we can use to to send signal while initializing schedule command with `waitfor` ?

Snehal Dwivedi 1 Reputation point
2021-10-18T10:41:34.067+00:00

In VB script there we can do this check here. Is there any similar option in PS? What I am trying to achieve is to convert the following VB command into PS

 @schtasks /create /f  /sc once /st 00:00:00 /tn chefclientbootstraptask /ru SYSTEM /rl HIGHEST /tr \"cmd /c #{command} & sleep 2 & waitfor /s %computername% /si chefclientinstalldone\"  

So here in this code I am not able to find an alternative for waitfor /s %computername% /si chefclientinstalldone\". Can anyone help if there is such an option or not?

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.