https://stackoverflow.com/questions/1741490/how-to-tell-powershell-to-wait-for-each-command-to-end-before-starting-the-next<\/a><\/p>","upvoteCount":1,"datePublished":"2014-05-28T01:18:27.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/2","author":{"@type":"Person","name":"simonmatthews","url":"https://community.spiceworks.com/u/simonmatthews"}},{"@type":"Answer","text":"$msi = @('C:\\test\\drive1.Wrapper.msi','C:\\test\\driver2.msi' )\n\nforeach ($msifile in $msi) {\n Start-Process -FilePath \"$env:systemroot\\system32\\msiexec.exe\" -ArgumentList \"/i $msifile /qn /passive\" -Wait\n\n **Start-Sleep 300**\n}\n<\/code><\/pre>","upvoteCount":6,"datePublished":"2014-05-28T01:27:05.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/3","author":{"@type":"Person","name":"cazibrasga5234","url":"https://community.spiceworks.com/u/cazibrasga5234"}},{"@type":"Answer","text":"Cazi: That start-sleep 300 will let the first msi run, then the second msi will run after 5 minutes?<\/p>","upvoteCount":0,"datePublished":"2014-05-28T01:45:03.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/4","author":{"@type":"Person","name":"ginger6412","url":"https://community.spiceworks.com/u/ginger6412"}},{"@type":"Answer","text":"
Hi, Cazi:<\/p>\n
I did work fine but only got this error<\/p>\n
: The term ‘’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling<\/p>\n
of the name, or if a path was included, verify that the path is correct and try again.<\/p>\n
At line:8 char:2<\/p>\n
\n\n}<\/p>\n<\/li>\n
\n~<\/p>\n<\/li>\n
\nCategoryInfo : ObjectNotFound: (:String) <\/span>, CommandNotFoundException<\/p>\n<\/li>\n<\/ul>\n+ FullyQualifiedErrorId : CommandNotFoundException<\/p>","upvoteCount":0,"datePublished":"2014-05-28T15:15:45.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/6","author":{"@type":"Person","name":"ginger6412","url":"https://community.spiceworks.com/u/ginger6412"}},{"@type":"Answer","text":"
ginger, that error indicates a problem with line 8, the script Cazi gave you isn’t even 8 lines long. Did you modified it? Please post your script.<\/p>","upvoteCount":0,"datePublished":"2014-05-29T10:59:05.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/7","author":{"@type":"Person","name":"craigduff","url":"https://community.spiceworks.com/u/craigduff"}},{"@type":"Answer","text":"
it is working but only start-sleep is not working well.<\/p>","upvoteCount":0,"datePublished":"2014-05-30T01:02:27.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/8","author":{"@type":"Person","name":"ginger6412","url":"https://community.spiceworks.com/u/ginger6412"}},{"@type":"Answer","text":"
I am not sure what happened now the script only run the first one and not run the second installation:<\/p>\n
<\/strong>$msi = @(‘C:\\test\\drive1.Wrapper.msi’,‘C:\\test\\driver2.msi’ )<\/p>\nforeach ($msifile in $msi)<\/p>\n
{Start-Process -FilePath “$env:systemroot\\system32\\msiexec.exe” -ArgumentList “/i $msifile /qn /passive” -Wait }<\/p>","upvoteCount":0,"datePublished":"2014-05-30T21:42:29.000Z","url":"https://community.spiceworks.com/t/how-to-pause-5-minutes-in-this-script/307312/9","author":{"@type":"Person","name":"ginger6412","url":"https://community.spiceworks.com/u/ginger6412"}}]}}
i have a script to install multiple msi package but I want to pause 5 minutes for the first msi installation then continue to install second msi package after 5 minutes: Please help. ( cannot find out script center in the community listed below so I place in the support session)
I am not sure where to put start-sleep…
$msi = @(‘C:\test\drive1.Wrapper.msi’,‘C:\test\driver2.msi’ )
foreach ($msifile in $msi)
{Start-Process -FilePath “$env:systemroot\system32\msiexec.exe” -ArgumentList “/i $msifile /qn /passive” -Wait}
5 Spice ups
$msi = @('C:\test\drive1.Wrapper.msi','C:\test\driver2.msi' )
foreach ($msifile in $msi) {
Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList "/i $msifile /qn /passive" -Wait
**Start-Sleep 300**
}
6 Spice ups
Cazi: That start-sleep 300 will let the first msi run, then the second msi will run after 5 minutes?
Yes. The instructions contained within the curly brackets will run for each of the MSIs.
1 Spice up
Hi, Cazi:
I did work fine but only got this error
: The term ‘’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At line:8 char:2
+ FullyQualifiedErrorId : CommandNotFoundException
ginger, that error indicates a problem with line 8, the script Cazi gave you isn’t even 8 lines long. Did you modified it? Please post your script.
it is working but only start-sleep is not working well.
I am not sure what happened now the script only run the first one and not run the second installation:
$msi = @(‘C:\test\drive1.Wrapper.msi’,‘C:\test\driver2.msi’ )
foreach ($msifile in $msi)
{Start-Process -FilePath “$env:systemroot\system32\msiexec.exe” -ArgumentList “/i $msifile /qn /passive” -Wait }