title: How to install IIS on Azure Windows VM using Azure Cli
body: <p>After Running this command on Azure Cli:</p>
  
  <pre><code>az vm extension set --publisher Microsoft.Compute --version 1.8 --name CustomScriptExtension --vm-name avmUat --resource-group argUat --settings '{"commandToExecute":"powershell.exe Install-WindowsFeature -Name Web-Server"}'
  </code></pre>
  
  <p>I get this error</p>
  
  <blockquote>
    <p>Deployment failed. Correlation ID:
    8d6972da-6d46-42e8-a053-f8e899348893. VM has reported a failure when
    processing extension 'CustomScriptExtension'. Error message: "Invalid
    handler configuration. Exiting. Error Message: Error converting value
    "{commandToExecute:powershell.exe Install-WindowsFeature -Name
    Web-Server}" to type
    'Microsoft.WindowsAzure.GuestAgent.Plugins.CustomScriptHandler.PublicSettings'.
    Path 'runtimeSettings[0].handlerSettings.publicSettings', line 5,
    position 102.".</p>
  </blockquote>
  
  <p><strong>Edit:</strong>
  The result when I run it in powershell on Azure Cloud Shell:
  <a href="https://i.stack.imgur.com/gKWm4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gKWm4.png" alt="enter image description here"></a></p>
  
  <p><strong>Bash</strong> and this is on bash (Gladly it worked)
  <a href="https://i.stack.imgur.com/PFVaE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PFVaE.png" alt="enter image description here"></a></p>