Page 1 of 2

.net remote install

Posted: Wed Jul 01, 2020 3:49 pm
by sekou2331
This may have been answered already but cant seem to find on this forum. I am trying to install .net 4.8 to remote machines. I am using the below but it seems like it is not working. The funny thing I am not getting error at all it is just not working. I have used this command for other process runs. Is it possible to install .net framework like this?

  1. Invoke-Command -ComputerName $computerName -ArgumentList "/q /norestart" -ScriptBlock {Start-Process -FilePath 'C:\tmp\ndp48-x86-x64-allos-enu.exe' $args[0] }

Re: .net remote install

Posted: Wed Jul 01, 2020 4:14 pm
by jvierra
What is the error?

Re: .net remote install

Posted: Wed Jul 01, 2020 4:21 pm
by sekou2331
That's the thing I am not getting an error. It just run and comes back . I even tried to run it locally and I just get the below as well with Passthru. No errors at all weird.

  1. Invoke-Command  -ArgumentList "/q /norestart" -ScriptBlock {Start-Process -FilePath 'C:\tmp\ndp48-x86-x64-allos-enu.exe' -ArgumentList $args[0] -Wait -PassThru}
and i just get this


Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
57 7 1204 4348 0.02 224 4 ndp48-x86-x64-allos-enu

Re: .net remote install

Posted: Wed Jul 01, 2020 4:24 pm
by jvierra
Don't use PassThru.

"Wait" won't work with installers.

Many installers cannot be used remotely. Contact the vendor for assistance and if it can work.

Re: .net remote install

Posted: Wed Jul 01, 2020 4:28 pm
by sekou2331
This is the .net installer. Why would it not work? will it be better I guess to put in a bat file. Hate to do that but will if have to.

Re: .net remote install

Posted: Wed Jul 01, 2020 4:32 pm
by jvierra
Why do you think a batch file will help. The issue is that installer EXE files run and start teh system installer. Most just terminate before the install is complete. Exiting the session will just terminate the installer. Either keep the session open until the installer quits or use a pre existing session.

If the installer cannot run silent then the installer may hang with no way to know it is hung. You must contact the vendor to know if this is possible.

Re: .net remote install

Posted: Mon Jul 06, 2020 10:40 am
by sekou2331
Ok figured out that this script actually works. Needs a restart to be fully install. Just added restart and registry check for the version. lol realized that I have norestart arg and needed to remove it.

Re: .net remote install

Posted: Tue Jul 07, 2020 7:44 am
by sekou2331
Have a quick question how can I not make the not path static? I tried the using: but it seems to not work. Invoke-Command does not see the path.
  1.  
  2. $path = 'C:\classInstalls\ndp48-x86-x64-allos-enu.exe'
  3. Invoke-Command -ComputerName $computerName -ArgumentList "/q /norestart" -ScriptBlock { Start-Process -FilePath  using:$path $args[0] }

Re: .net remote install

Posted: Tue Jul 07, 2020 9:08 am
by jvierra
Too many "not" in the question. It cannot be undrestaood.

Re: .net remote install

Posted: Mon Jul 13, 2020 12:55 pm
by localpct
$path = 'C:\classInstalls\ndp48-x86-x64-allos-enu.exe'
Invoke-Command -ComputerName $computerName -ArgumentList "/q /norestart" -ScriptBlock { Start-Process -FilePath using:$path $args[0] -WorkingDirectory ?????????? }

Do you need to include a WorkingDirectory?