Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 3.31 KB

powershell-setup.md

File metadata and controls

82 lines (59 loc) · 3.31 KB
services title author solutions manager editor ms.service ms.devlang ms.topic ms.tgt_pltfrm ms.workload ms.date ms.author
virtual-machines
Setting up PowerShell
JoeDavies-MSFT
timlt
tysonn
virtual-machines
na
article
infrastructure
05/12/2015
rasquill

Setting up PowerShell

Before you can use Azure PowerShell, follow these steps.

Verify PowerShell versions

Before you can use Windows PowerShell, you must have Windows PowerShell, Version 3.0 or 4.0. To find the version of Windows PowerShell, type this command at a Windows PowerShell command prompt.

$PSVersionTable

You should see something like this.

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18444
BuildVersion                   6.2.9200.16481
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2

Verify that the value of PSVersion is 3.0 or 4.0. To install a compatible version, see Windows Management Framework 3.0 or Windows Management Framework 4.0.

You should also have Azure PowerShell version 0.8.0 or later. You can check the version of Azure PowerShell that you have installed with this command at the Azure PowerShell command prompt.

Get-Module azure | format-table version

You should see something like this.

Version
-------
0.8.16.1

For instructions and a link to the latest version, see How to Install and Configure Azure PowerShell.

Set your Azure account and subscription

If you don't already have an Azure subscription, you can activate your MSDN subscriber benefits or sign up for a free trial.

Open an Azure PowerShell command prompt and log on to Azure with this command.

Add-AzureAccount

If you have multiple Azure subscriptions, you can list your Azure subscriptions with this command.

Get-AzureSubscription

You will receive the following type of information:

SubscriptionId            : fd22919d-eaca-4f2b-841a-e4ac6770g92e
SubscriptionName          : Visual Studio Ultimate with MSDN
Environment               : AzureCloud
SupportedModes            : AzureServiceManagement,AzureResourceManager
DefaultAccount            : [email protected]
Accounts                  : {[email protected]}
IsDefault                 : True
IsCurrent                 : True
CurrentStorageAccountName : 
TenantId                  : 32fa88b4-86f1-419f-93ab-2d7ce016dba7

You can set the current Azure subscription by running these commands at the Azure PowerShell command prompt. Replace everything within the quotes, including the < and > characters, with the correct name.

$subscr="<SubscriptionName from the display of Get-AzureSubscription>"
Select-AzureSubscription -SubscriptionName $subscr -Current    

For more information about Azure subscriptions and accounts, see How to: Connect to your subscription.