title: Check if Azure VM name exists before deploying arm template
body: <p>I am trying to use Azure powershell to get VM name (Eg: <code>demovm01</code>, where the VM name is <code>demovm</code> and the suffix is <code>01</code>. </p>
  
  <p>I want to get the output and automatically append a new suffix of <code>02</code> if <code>01</code> already exists.</p>
  
  <p>Sample script to get vm name:</p>
  
  <pre><code>$getvm = Get-AzVM -Name "$vmname" -ResourceGroupName "eodemofunction" -ErrorVariable notPresent -ErrorAction SilentlyContinue
  if ($notPresent) {
      Write-Output "VM not found. Creating now"
  }
  else {
      Write-Output "VM exists."
      return $true    
  }
  </code></pre>
  
  <p>I want to be able to inject this new vm name to an arm deploy to deploy</p>