0

Attempting to silently install .Net 4.7.2 on a remote machine using Invoke-Command but no matter what type of parameters I've tried I keep getting...

  • Invoke-Command : Parameter set cannot be resolved using the specified named parameters.

I've tried parameters like /q /quiet /passive and all that is provided keeps on getting the error.

Invoke-Command -ComputerName $problemChild -ScriptBlock { Start-Process "c:\windows\temp\dotNet472.exe" -ArgumentList '/q /norestart' -Wait -NoNewWindow -ErrorAction SilentlyContinue -ErrorVariable dotNetError -Verb RunAs }

Expecting to install .Net 4.7.2 silently with no reboot, just incase the user is still logged in.

Executing the command on a Win 7 with PS version 4 on a remote machine running Win 7 PS 2. I've confirmed that the parameters passed are the correct ones from MS article.

** Edit: Removing -NoNewWindow get's rid of the error but the installer doesn't run. While running the command below on the remote machine, get's the installer going and no issues are seen.

Start-Process "c:\windows\temp\dotNet472.exe" -ArgumentList '/q /norestart' -Wait -ErrorAction SilentlyContinue -ErrorVariable dotNetError -Verb RunAs
titant3ch
  • 81
  • 8
  • It looks like `-NoNewWindow` and `-Verb` cannot be used at the same time. Check out the help for details: [Start-Process](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-6) – boxdog May 08 '19 at 15:46
  • Understood but even with out all the -Wait -NoNewWindow -ErrorAction SilentlyContinue -ErrorVariable I see the process running on the remote machine and then it closes. – titant3ch May 08 '19 at 16:05
  • Try specifying the arguments as an array: `-ArgumentList '/q', '/norestart'`. Not sure if it will help, but worth a try. Also, what happens if you log onto the remove server and run the `Start-Process ...` command directly in PowerShell? – boxdog May 08 '19 at 16:13
  • Running it directly from the remote machine has no problems, that's how I created the silent install first, .Net updates and no reboot happens. I did try as an array just now and still no luck. – titant3ch May 08 '19 at 16:22
  • The `Invoke-Command` also has a `-Credential` parameter. Perhaps use that in combination with the credentials of a domain admin? – Theo May 08 '19 at 18:38
  • Are you an admin on the remote server? Is the PowerShell session on the local server an elevated session (Run As Administrator)? – TheMadTechnician May 08 '19 at 22:57
  • Im running it with my domain admin credentials. When running it on the remote machine, it just launches with my domain admin creds, same used to invoke-command on remote machine – titant3ch May 09 '19 at 19:32

0 Answers0