.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.
This topic is 3 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
sekou2331
Posts: 318
Last visit: Sat Oct 28, 2023 7:46 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: .net remote install

Post by jvierra »

What is the error?
User avatar
sekou2331
Posts: 318
Last visit: Sat Oct 28, 2023 7:46 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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: 318
Last visit: Sat Oct 28, 2023 7:46 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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: 318
Last visit: Sat Oct 28, 2023 7:46 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: 318
Last visit: Sat Oct 28, 2023 7:46 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. $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] }
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: .net remote install

Post by jvierra »

Too many "not" in the question. It cannot be undrestaood.
User avatar
localpct
Posts: 397
Last visit: Thu Oct 27, 2022 5:57 am

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?
This topic is 3 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked