I’m working on installing Java on remote hosts and have the basis for a script. However, I’m having problems with installing java remotely either by invoke-command or enter-possession. I use the following line to install Java successfully locally but so far the command will complete remotely with no errors but does not install java. Any ideas on how to troubleshoot this?
Thanks for the responses Matt & Yuan!! I ran the following command:
Invoke-Command -ComputerName cpu -Credential dom\acc -ScriptBlock { Start-Process -filepath “c:\temp\java.exe” -argumentlist “/s /L c:\temp\install.txt” -Verb runas -PassThru -Wait }
The command executes and responds :
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName PSComputerName
0 2 50864 152 54 0.05 1164 java cpu
However, there is no log file and java does not install.