Sandeep
Sandeep

Reputation: 137

Remote installation of exe using powershell

I have a script to copy a file to remote servers C:\temp and also to execute the exe file remotely. But the problem here is, it is copying .exe file to c:\temp of the remote machine, but not executing the exe.

Can anyone help me to correct here ?

ForEach ($Computer in Get-Content C:\scripts\servers.txt)
{
 Copy-Item -Path '\\serverA\c$\scripts\Firefox Setup 52.0.1.exe' -Destination \\$Computer\c$\temp\;
 Invoke-Command -AsJob -ComputerName $Computer -ScriptBlock { & "C:\temp\Firefox Setup 52.0.1.exe -ms" } 
}

Upvotes: 0

Views: 959

Answers (1)

Harisudhan. A
Harisudhan. A

Reputation: 672

Try this, Step by step breif explation is given for Installing-remote-software using Powershell

Upvotes: 1

Related Questions