Script to Install Windows XP updates Hangs

Hi,

Environment: Server 2008 or Server 2012 (Script to be run from)
Client PC’s: Windows XP PC’s with PS Remoting enabled and connectivity verified.

I am trying to develop a process which will look for any update.exe files stored in a particular folder on the PC and install them on the local XP PC.

I have developed the install script and when I run this on the target PC while logged in interactively it seems to find the setup files and install them. The trouble I am having is when I try to use the Invoke-Command method to run the install script from a server. The reason I am trying to do it this way is to schedule the installs on multiple PC’s. When the script is run I can see it trying to install the setup.exe file but it just hangs and doesn’t complete the install or move on to the next one. I am not sure what might be causing this and any help would be greatly appreciated.

I thought it might be the install switches but when I tries /quiet it still has the same issue.

I have copied the install code below:

foreach ($CustomXPUpdate in $CustomXPUpdates)
{
Write-Log " "

$InstallUpdate = $LocalHotfixPath + $CurrentYear + ("") + $CurrentMonth + ("") + $CustomXPUpdate

$KBName = $CustomXPUpdate -replace “WindowsXP-”, “” -replace “IE8-WindowsXP-”,"" -replace “-x86-Custom-ENU.exe”, “”

	Write-Log " "
	Write-Log "Current Update installation path is: $InstallUpdate"
	Write-Log "Current update in pipleine $CustomXPUpdate"
	Write-Log "Checking to see if $KBName is installed on $($env:COMPUTERNAME)"
	Write-Log " "
if (!(get-hotfix -id $KBName)) {

	Write-Log " $KBName is not Installed"
	Write-Log "Installing $CustomXPUpdate ..."
	Write-Log " "

Start-Process -FilePath "$InstallUpdate" -ArgumentList	/passive" /Norestart" -Wait


	if (!(get-hotfix -id $KBName)) {

	Write-Log " $CustomXPUpdate did not Install correctly, Please Investigate"
	Write-Log " "
	Write-Log " "

	}
	else
	{
	Write-Log " [SUCCESS] $CustomXPUpdate has been installed on $($env:COMPUTERNAME) "
	Write-Log " "
	Write-Log " "
	}

Could you format your codeblock? It would be much easier to read.

Hi Hermann,

thanks for interest, I am very new to PowerShell so apologise in advance for the poor scripting…
the write-log is a function defined earlier in the script. Is there a way to see what the setup.exe is waiting for? My log file records events but only the ones I specify with the “write-Log” function.

foreach ($CustomXPUpdate in $CustomXPUpdates)
{
     Write-Log " "
     $InstallUpdate = $LocalHotfixPath + $CurrentYear + ("\") + $CurrentMonth + ("\") + $CustomXPUpdate
     $KBName = $CustomXPUpdate -replace "WindowsXP-", "" -replace "IE8-WindowsXP-","" -replace "-x86-Custom-ENU.exe", ""
     Write-Log " "
     Write-Log "Current Update installation path is: $InstallUpdate"
     Write-Log "Current update in pipleine $CustomXPUpdate"
     Write-Log "Checking to see if $KBName is installed on $($env:COMPUTERNAME)"
     Write-Log " "
 
  if (!(get-hotfix -id $KBName))
     {
       Write-Log " $KBName is not Installed"
       Write-Log "Installing $CustomXPUpdate ..."
      Write-Log " "
      Start-Process -FilePath "$InstallUpdate" -ArgumentList /passive" /Norestart" -Wait
            if (!(get-hotfix -id $KBName)) 
               {
               Write-Log " $CustomXPUpdate did not Install correctly, Please Investigate"
               Write-Log " "
               Write-Log " "
               }
  else
              {
               Write-Log " [SUCCESS] $CustomXPUpdate has been installed on $($env:COMPUTERNAME) "
               Write-Log " "
               Write-Log " "
               }

some updates want to accept license…