Am sending a powershell script using CustomData parameter (HTTP) while creating a Windows VM. The content is found in AzureData folder of the VM , named CustomData.bin. How can i execute the CustomData? My powershell command is,
<powershell>
(New-Object System.Net.WebClient).DownloadString("https://<URL to download .ps1>") > "C:\provision.ps1"
Set-ExecutionPolicy Unrestricted -Force
cd C:\
.\provision.ps1
</powershell>
I want this script to be executed once the VM is created. Could anyone please suggest how can i implement this?