title: Coverage of powershell script using Pester
body: <p>I am trying to unit test my Powershell script file with below code snippet using Pester </p>
  
  <pre><code>#code to create a 7z file 
  $7zipPath = "C:\Program Files\7-Zip\7z.exe"
  Set-Alias 7zip $7zipPath
  if (!(Test-Path -Path $7zipPath -PathType Leaf)) {
      throw "7 zip file '$7zipPath' not found"
  }
  7zip a -mx=9 $jenkinsWorkspacepath\IntegrationZip.7z $jenkinsWorkspacepath\IntegratedScripts
  </code></pre>
  
  <p>And mocking the Test-Path command as below</p>
  
  <pre><code>    Mock -CommandName Test-Path –MockWith {
          Return $false  
      }
  </code></pre>
  
  <p>But the coverage report shows the below line as uncovered.. What am i doing wrong here(in the mocking part)?</p>
  
  <pre><code>**throw "7 zip file '$7zipPath' not found"**
  </code></pre>