I am trying to pass 2 parameters to a PS script which will patch the SQL Server on a remote machine. Here is the code i used :
$Patcher = "\\remoteShareLocation\SQLpatcher.ps1"
$ver = "SQL2012"
$inst = "NEWINST"
Invoke-Command -ComputerName RMTMACHINE -credential dmn\usrname -ScriptBlock {$Patcher $ver $inst}
This asks for credentials but doesn't run and show any output also. Anything wrong with syntax ? Any alternate cmdlet please ?