I recently started to play with Azure with PowerShell.When you use Azure, you have severals options :
Today, we’ll have a look at the PowerShell option. First, you’ll need to download and install it.
PowerShell 5 way (
OneGet – PackageManagement):
Find-Package AzurePowerShell | Install-Package
PowerShell <5, you’ll need to do it manually, you can find the package to download here.
Once installed, you may want to connect, you have two options for that :
- Login at each PowerShell start
- Download a special file to authenticate you automatically
This will popup a window when you can enter your Azure credentials :
Option 2 :
The first cmdlet will help you to download a special file, and the second will import it, you may need to change the path to your special file.
Get-AzurePublishSettingsFile Import-AzurePublishSettingsFile "C:Users$env:usernameDownloadsMySubscription-6-3-2015-credentials.publishsettings"
Once you’re connected, you can start using all the cmdlets included in the Azure PowerShell module (641 of them in version 0.8.16 of the module) :
A lot of them looks like the ones from Hyper-V module.
You can check if you’re connected by looking at the subscriptions on your Azure tenant :
You can then choose the one you want to work with :
Select-AzureSubscription -SubscriptionName 'MySubscriptionName'