title: Running Batch Script on remote Server via PowerShell
body: <p>I need to connect to some remote servers from a client (same domain as the servers) once connected, I need to run a batch file:</p>
  
  <p>I've done so with this code:</p>
  
  <pre><code>$Username = 'USER'
  $Password = 'PASSWORD'
  $pass = ConvertTo-SecureString -AsPlainText $Password -Force
  $Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
  
  try {
      Invoke-Command -ComputerName "SERVER1" -Credential $Cred -ScriptBlock -ErrorAction Stop {
          Start-Process "C:\Users\nithi.sundar\Desktop\Test.bat"
      }
  } catch {
      Write-Host "error"
  }
  </code></pre>
  
  <p>This script does not give any errors, but it doesn't seem to be executing the batch script.</p>
  
  <p>any input on this would be greatly appreciated.</p>