Pages

Thursday, May 10, 2018

Attempting to use the Invoke-Command PowerShell cmdlet to remotely install an application hangs indefinitely without starting the installation

Problem

You’ve enabled PSRemoting on a remote server or desktop and attempt to use the Invoke-Command PowerShell cmdlet to remotely install an application with the following cmdlet:

Invoke-Command -computername wkst-122 -ScriptBlock {Start-Process -FilePath 'C:\temp\agent\VMware-viewagent-x86_64-6.2.1-3284564.exe' -ArgumentList '/S /V"/qn' -Wait}

image

… but the cmdlet executes and hangs indefinitely without starting the installation on the remote computer.  You do notice that the msiexec.exe process is briefly displayed on the target computer’s task manager when the cmdlet is executed but it disappears after a second.

Solution

The first two obvious items to check are:

  1. Ensure PSRemoting is enabled
  2. The installation file is not on a UNC share as it must be copied locally on the target computer

The one item that is not as obvious and had me stumped for an hour is to ensure that the executable is not blocked. 

If you are copying the executable from a file server then executing the install command then ensure the executable on the file server is unblocked and if you already have the file on the target computer then ensure that the file is unblocked.

image

No comments: