.net remote install

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
sekou2331
Posts: 297
Joined: Wed Aug 15, 2012 6:07 am

.net remote install

Post 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] }

jvierra
Posts: 14616
Joined: Tue May 22, 2007 9:57 am
Answers: 3
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: .net remote install

Post by jvierra »

What is the error?

User avatar
sekou2331
Posts: 297
Joined: Wed Aug 15, 2012 6:07 am

Re: .net remote install

Post 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

jvierra
Posts: 14616
Joined: Tue May 22, 2007 9:57 am
Answers: 3
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: .net remote install

Post 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.

User avatar
sekou2331
Posts: 297
Joined: Wed Aug 15, 2012 6:07 am

Re: .net remote install

Post 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.

jvierra
Posts: 14616
Joined: Tue May 22, 2007 9:57 am
Answers: 3
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: .net remote install

Post 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.

User avatar
sekou2331
Posts: 297
Joined: Wed Aug 15, 2012 6:07 am

Re: .net remote install

Post 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.

User avatar
sekou2331
Posts: 297
Joined: Wed Aug 15, 2012 6:07 am

Re: .net remote install

Post 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.  
  3. $path = 'C:\classInstalls\ndp48-x86-x64-allos-enu.exe'
  4.  
  5. Invoke-Command -ComputerName $computerName -ArgumentList "/q /norestart" -ScriptBlock { Start-Process -FilePath  using:$path $args[0] }

jvierra
Posts: 14616
Joined: Tue May 22, 2007 9:57 am
Answers: 3
Has voted: 1 time
Been upvoted: 3 times
Contact:

Re: .net remote install

Post by jvierra »

Too many "not" in the question. It cannot be undrestaood.

User avatar
localpct
Posts: 320
Joined: Wed Sep 09, 2015 12:53 pm

Re: .net remote install

Post 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?

Locked