2

Good Afternoon, I'm having some troubles getting the Microsoft Edge .msi to install onto a windows server 2012R2 through PowerShell Remoting. The code works on my local machine but when I try to parse it through with remoting it just hangs there and nothing happens. I've waited up to an hour in trying to troubleshoot this, so just looking for some help. \

The .msi file is located locally on the server. I do know that the PS Remoting connects to the server as I can pass commands to make folders as an example.

Invoke-Command $Server -Scriptblock {
    Write-Host "Installing Microsoft Edge"
    Start-Process C:\Source\BuildSource\Laptop\21-MicrosoftEdge\MicrosoftEdgeEnterpriseX64.msi /quiet -wait
    Write-Host "Microsoft Edge Installed"
}
Fitzgery
  • 558
  • 5
  • 14
  • I assume its due to the specific path `Start-Process C:\Source\BuildSource\Laptop\21-MicrosoftEdge\MicrosoftEdgeEnterpriseX64.msi /quiet -wait` but if that is the correct path the `/quiet` is misplaced regardless. It is an argument for the msi itself so you should either add `-Args "/quiet"` or try using msiexec instead of `Start-Process` – Nico Nekoru Apr 09 '21 at 19:04
  • That is the specific path the file is located in. But I can try getting rid of `Start-Process` and use msiexec. What I don't understand though is I can take that same line of code, and run it on my local machine and it'll install properly. The issue only occurs once I try to parse it through PS-Remoting on my server – Fitzgery Apr 11 '21 at 23:52
  • What are the permissions of the prinicpal accessing on $Server? Personnally I prefer being more explicit and specify msiexec. Have you tried to output log information when running the msi ie. /L*V "C:\Source\BuildSource\Laptop\21-MicrosoftEdge\example.log" ? – P-L Apr 12 '21 at 19:21
  • I've not tested this but I suspect the "/quiet" switch is not being accepted when running unattended. MSI should accept "/qn" or "/qb!" instead. Use this for reference: https://silentinstallhq.com/microsoft-edge-version-85-silent-install-how-to-guide/ – SolidSid Apr 13 '21 at 10:16

1 Answers1

4

Further to my comment I've just tested out the below method:

$installArgs = @(
    "/i"
    "C:\temp\MSEdge\MicrosoftEdgeEnterpriseX64.msi"
    "/qb!"
    )

Invoke-Command $Server -Scriptblock {
    write-Host "installing Microsoft Edge" 
    Start-Process "msiexec.exe" -ArgumentList  $installArgs -Wait
    Write-Host "Microsoft Edge installed" 
    }

I'd recommend adding some logging too.

SolidSid
  • 319
  • 1
  • 10
  • When I try running it, I'm getting this error `Cannot validate argument on parameter 'ArgumentList'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.` I'm off work today, so troubleshooting will have to happen tomorrow, but thank you for the reply! – Fitzgery Apr 13 '21 at 11:40
  • No problem. Could you post your working when you come to debug and I'll take a look. – SolidSid Apr 13 '21 at 11:42
  • 2
    Run this code without `$installArgs`, just change the start-process line to `Start-Process "msiexec.exe" -ArgumentList "/i 'C:\temp\MSEdge\MicrosoftEdgeEnterpriseX64.msi' /qb!" -Wait` –  Apr 13 '21 at 16:09
  • Using $installArgs is a personal preference while building the script. I find it easier to build up the parameters one by one during testing so I can confirm each behaves as it should do. – SolidSid Apr 14 '21 at 07:29
  • @SolidSid So I don't know what the deal was the other day but I ran your suggestion again and included logging, but this time it seems to have worked and installed no problem! – Fitzgery Apr 14 '21 at 13:54
  • @Fitzgery great news, would you mind marking your question as answered? – SolidSid Apr 14 '21 at 14:01