Skip to content

Instantly share code, notes, and snippets.

@mattcorr
Created April 25, 2015 08:55
Show Gist options
  • Save mattcorr/f496ec7e4bc0d7333ea6 to your computer and use it in GitHub Desktop.
Save mattcorr/f496ec7e4bc0d7333ea6 to your computer and use it in GitHub Desktop.
azure ad test workflow
workflow Azure-AD-Test
{
# Get required variables
$cred = Get-AutomationPSCredential -Name 'Automation Account'
$subName = Get-AutomationVariable -Name 'Subscription Name'
$vmCred = Get-AutomationPSCredential -Name 'VM Account'
#perform authentication
Add-AzureAccount -Credential $cred
Select-AzureSubscription -SubscriptionName $subName
# get the remote VM URI
$uri = Get-AzureWinRMUri -ServiceName 'azureautodemo' -Name 'azureautodemo'
# perform the action on the VM
Create-Folder -VMUri $uri -VMCredential $vmCred -Folder 'C:\THIS-IS-A-TEST'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment