title: Install and invoke Pester remotely
body: <p>I'm new to PowerShell, Pester <em>and</em> the new VSO build system and I'm trying to get Pester to run my tests for each check in. I've set up and configured a simple PowerShell script to run on each check in.</p>
  
  <p><img src="https://i.stack.imgur.com/xDVH6.png" alt="PowerShell Configured"></p>
  
  <p>I first tried simply Invoke-Pester to see if the VSO team had envisioned this and set up common unit test frameworks, but I go the following predictable result:</p>
  
  <pre><code>Invoke-Pester : The term 'Invoke-Pester' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  At C:\a\64df1c11\Operations Tools\powershell\runPowershellTests.ps1:1 char:1
  + Invoke-Pester
  + ~~~~~~~~~~~~~
  + CategoryInfo : ObjectNotFound: (Invoke-Pester:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException
  </code></pre>
  
  <p>I tried to use PSGet:</p>
  
  <pre><code>(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
  install-module Pester
  Invoke-Pester
  </code></pre>
  
  <p>But that isn't working either:</p>
  
  <pre><code>New-Item : Access to the path 'PsGet' is denied.
  At line:17 char:5
  + New-Item -Path ($Destination + "\PsGet\") -ItemType Directory -Force | Out-N ...
  </code></pre>
  
  <p>How can I remotely install and execute Pester to run my unit tests?</p>