Created
May 7, 2020 05:04
-
-
Save sandeepkv93/002f3bde5beb0d346c1a1405f5bea81b to your computer and use it in GitHub Desktop.
Windows Powershell script for InVM Notification using Azure Metadata Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. RDP into the VM | |
# 2. Open PowerShell in Administrator Mode. | |
# 3. Run the command ‘Set-ExecutionPolicy Unrestricted’. | |
# 4. Create a powershell script called ‘windows-invm-notification.ps1’ and copy the following content in the file. | |
DO | |
{ | |
Invoke-WebRequest http://169.254.169.254/metadata/scheduledevents?api-version=2019-01-01 -H @{"Metadata"="true"}; | |
Start-sleep -Seconds 2; | |
} While ($true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment