Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Running CustomData script in Azure Windows VM

$
0
0

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?


Viewing all articles
Browse latest Browse all 12545

Trending Articles