title: Azure ARM Template Testing with Pester
body: <p>I have been following the link</p>
  
  <p><a href="https://stackoverflow.com/questions/47278046/azure-arm-template-testing">Azure ARM Template Testing</a> on how to carry out ARM testing with Pester.</p>
  
  <p>Unfortunately, I'm unable to get a successful tests.</p>
  
  <p>For example in the script the following code states the following:</p>
  
  <p>It "Does Availability Set Have Correct SKU" {
              $av = $deploymentOutput.validatedResources | Where-Object { $_.type -eq 'Microsoft.Compute/availabilitySets' }</p>
  
  <pre><code>        $av.sku.name | Should Be **'Align'**
  </code></pre>
  
  <p>However, even though the result of the ARM template is 'Align' I get the following error.</p>
  
  <p><a href="https://i.stack.imgur.com/cSvmo.png" rel="nofollow noreferrer">error</a></p>
  
  <p>Whereas I should be getting the following successful output:</p>
  
  <p><a href="https://i.stack.imgur.com/Oh6tO.png" rel="nofollow noreferrer">success</a></p>
  
  <p>For a complete look at the code it can be found <a href="https://github.com/bentaylorwork/azure-arm-templates/blob/master/disk-management-selection/tests/unit.tests.ps1" rel="nofollow noreferrer">here</a></p>
  
  <p>Any guidance will greatly appreciated.</p>
  
  <p>Regards</p>