Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Exe file remote Execution using powershell

$
0
0

I'm trying to write a script which will patch SQL Instances remotely. Referring this forum, I have framed the following line for executing the .exe remotely on other server:

Invoke-Command -ComputerName $computer -ScriptBlock {& cmd /c 'D:\SQL_PATCH\SQLServer2012SP2-KB2958429-x64-ENU.exe'  /qs /action=patch /allinstances /IAcceptSQLServerLicenseTerms}

Also tried this as well:

Invoke-Command -ComputerName $computer -ScriptBlock {& 'D:\SQL_PATCH\SQLServer2012SP2-KB2958429-x64-ENU.exe' -ArgumentList "/qs", "/action=patch", "/allinstances", "/IAcceptSQLServerLicenseTerms"}

Kindly help me on this.


Viewing all articles
Browse latest Browse all 6937

Trending Articles