title: Mock azure cli commands with Pester
body: <p>I have a buch of Azure Cli scripts that I have put inside a powershell function, for example:</p>
  <pre><code>function NewAppRegistration($name, $replyUrls, $resourceAccessesFilePath) {   
      $appRegistration = az ad app create `
          --display-name $name `
          --reply-urls $replyUrls `
          --oauth2-allow-implicit-flow true `
          --available-to-other-tenants false `
          -o json | 
      ConvertFrom-Json
  
      if (Test-Path $resourceAccessesFilePath) {
          $appRegistration = az ad app update `
          --id $appRegistration.appId `
          --required-resource-accesses $resourceAccessesFilePath
      }
  
      return $appRegistration
  }
  
  </code></pre>
  <p>And I want to mock <code>az ad app create</code> but I have no clue how to proceed and I also don't find any example of how to to that. Of course I could end up creating for every <code>az</code> command my own powershell function and I could mock these functions, but I wonder if it could not be made easier?</p>