Skip to content

Instantly share code, notes, and snippets.

@papsl
Created August 17, 2015 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save papsl/7f499e4690a58e885319 to your computer and use it in GitHub Desktop.
Save papsl/7f499e4690a58e885319 to your computer and use it in GitHub Desktop.
Azure - Open PowerShell session to Azure Virtual Machine (complete with publish settings)
#Download file
Get-AzurePublishSettingsFile
#Import Publishing file
Import-AzurePublishSettingsFile -PublishSettingsFile "publishsettingsfile.publishsettings"
#List all profiles
Get-AzureSubscription
#Select active AzureSubscription
Select-AzureSubscription "Visual Studio Premium with MSDN"
# Start machine
Start-AzureVM -Service "ServiceName" -Name "ServerName"
# Open PowerShell command session to VM
Enter-PSSession -ConnectionUri (Get-AzureWinRMUri) -SessionOption (New-PSSessionOption -SkipCACheck) -Credential (Get-Credential)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment