I want to execute a .cmd
file on a remote server, through Powershell. This works well:
Invoke-Command -ComputerName <computerName> -credential $cred -ScriptBlock {&"C:\...\Script.cmd"}
But what is the syntax to run Script.cmd
"as administrator" ?