I have a powershell script which takes a number of hostnames as input, then install IE11 and Office 2010 in them. Currently it install these in one host, then continue to the next one etc. This is simply wasting time as the installation in one will not affect the other one. So how can i make it to run in parallel ? TIY Here is my code :
Write-Host "*************************************************"
Write-Host "Welcome to the IE11/Office 2010 Remote Installer"
Write-Host "*************************************************"
$pclist = (Read-Host "Enter the pc names seperated by comma").Split(",")
foreach ($pc in $pclist) {
Write-Host "-------------------------------------------------------------------------------------------------------"
Write-Host "Installing IE in $($pc). Please look for the exit code in the end. Exit code 0 means successful"
psexec -s \\$pc \\myserver\directory\PREREQ.BAT
psexec -s \\$pc \\myserver\directory\INSTALL.BAT
Write-Host "-------------------------------------------------------------------------------------------------------"
Write-Host "Installing office in $($pc). Please look for the exit code in the end. Exit code 0 means successful"
psexec -s \\$pc \\myserver\directory\INSTALL.BAT
Write-Host "-------------------------------------------------------------------------------------------------------"
Write-Host "RESTART THE PC TO APPLY CHANGES"
}