title: Running PSSession from jenkinsfile
body: <p>Within my Jenkinsfile, I am trying to open a powershell PSSession to a remote machine to install some software, but it seems to ignore this step and just run all the next commands locally, instead of the machine I am trying to PSSession to..</p>
  <p>Here is my code:</p>
  <pre><code>pipeline {
  agent { label 'slave-windows' }
  stages {
      stage('Parameters') {
          steps {
              script {
              properties([
                  parameters([
                              string(name: 'VM_NAME', defaultValue: '', description: 'Enter the VM name'),
                  ])
              ])
              }
          }
      }
      stage('install') {
          steps {
              powershell &quot;&quot;&quot;
                  Enter-PSSession ${params.VM_NAME}
                  New-Item &quot;C:\\salt&quot; -itemType Directory
                  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
                  Invoke-WebRequest -Uri &quot;https://repo.saltproject.io/windows/Salt-Minion-3004.2-Py3-AMD64-Setup.exe&quot; -OutFile “C:\\salt\\Salt-Minion-3004.2-Py3-AMD64-Setup.exe&quot;
                  C:\\salt\\Salt-Minion-3004.2-Py3-AMD64-Setup.exe /S /master=master /minion-name=${params.VM_NAME}
              &quot;&quot;&quot;
          }
      }
  }
  </code></pre>
  <p>I don't see any output in the build log regarding the PSSession command, but it goes ahead and runs all the remaining steps locally on the windows slave instead. Any ideas?</p>