title: Need to connect to remote server and execute ps1 script using jenkins
body: <p>I created a Jenkins job that needs to connect to a remote machine and execute a ps1 script.</p>
  
  <pre><code>$pw = convertto-securestring -AsPlainText -Force -String "4444"
  $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "eeeee\eee",$pw
  $sess = New-PSSession -ComputerName server1 -Credential $cred
  Enter-PSSession $sess
  </code></pre>