title: How to run simple custom commands on a Azure VM (win 7,8,10, Server) post deploy?
body: <p>I'm looking into how I can run commands remotely on a freshly deployed windows VM in Azure, and have a few basic questions.</p>
  
  <p>It seems like the 'Custom Script Extension' is the answer, but according to the documentation, is stated as only applicable for Server operating systems:</p>
  
  <p><a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/extensions-customscript" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/virtual-machines/windows/extensions-customscript</a></p>
  
  <p>This is correct I assume? And if so, what about non-server windows OS?</p>
  
  <p>Moving on, I have tried using the Custom Script Extension against a Windows Server 2016 data centre, based on the MS tutorial at:
  <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-linux-cli-sample-create-vm-nginx?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-linux-cli-sample-create-vm-nginx?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json</a></p>
  
  <p>My aim was to create a new Windows VM and instruct it to simply create a new dir after deployment. </p>
  
  <p>CLI Steps:</p>
  
  <pre><code>1. Create a resource group
  2. Create a new virtual machine (Server 2016 Datacentre) 
  3. Finally, run the following command:
  </code></pre>
  
  <p><code>az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name (nameOfMyVM) --resource-group (nameOfMyResourceGroup) --settings '{"commandToExecute":"powershell.exe md c:\testFolder"}</code>'</p>
  
  <p>This returns the error:</p>
  
  <pre><code>Handler 'Microsoft.Azure.Extensions.CustomScript' has reported failure for VM Extension 'CustomScript' with terminal error code '1007' and error message: 'Install failed for plugin (name: Microsoft.Azure.Extensions.CustomScript, version 2.0.3) with exception The specified executable is not a valid application for this OS platform.'
  </code></pre>
  
  <p>Should extra steps have been involved to accomplish this action on the VM successfully?</p>
  
  <p>Thanks </p>