For this to work, you need to have an existing subscription with Microsoft Azure. You can also register for free trial worth 200$ or you can outright purchase Azure.
You can run the cmdlets from the standard Windows PowerShell console, or from PowerShell Integrated Scripting Environment (ISE). First command you type is to login to get authenticated with Azure services.
If you need to login into Azure classic portal, you can use cmdlet Login-AzureAccount to start with. If you are logging into new Azure resource manager portal, you need to use Login-AzureRMAccount to login. Depending upon your subscription and account type, this may present a pop-up window where you can type your credentials to login. Once it completes, it will save your credentials for session.
You can have multiple accounts and subscriptions available for use by Azure PowerShell. You can add multiple accounts by running Add-AzureRmAccount more than once. To display the available Azure accounts, type Get-AzureAccount. To display your Azure subscriptions, type Get-AzureRmSubscription.
The Switch-AzureMode cmdlet switches between the Azure and Azure Resource Manager (AzureResourceManager) modules.
Switch-AzureMode [-Name] <AzureModule> [-Global] [ <CommonParameters>]
However, starting with v0.9 or greater (which should be default download now as of today), above cmdlet stands deprecated. If you have been through my earlier post, you can see that we installed v1.0 and above for all 3 modules.