Command 1:
#Connect to an Azure subscription accountadd-Azureaccount#get all the azure subscriptions that are connectedget-Azureacountget-azuresubscription#set up your current Azure subscription accountSelect-azuresubscription-Name ' free Trial '#Get all storage accounts in the current subscriptionget-Azurestorageaccount#Verify that the service name is availableTest-azurename-service"test323"#Create a storage account using PowerShellNew-azurestorageaccount-storageaccountname"test323"-location"West US"#Get all Azure servicesget-Azureservice#set a default storage accountSet-azuresubscription-subscriptionname ' Free Trial '-currentstorageaccountname ' engagementportal '#get all containers in the default storage accountget-Azurestoragecontainer#get all the BLOBs in the container db-backup and select Show Name columnGet-azurestorageblob-container Db-backup |Select Name#gets all the blobs in the container db-backup, assigns them to the variable $blog, and views the number of blobs returned$blob= Get-azurestorageblob-container db-Backup$blob. Count#uploading local files to the Azure containerGet-childitem–path c:\images\* | Set-azurestorageblobcontent-container"Yourcontainername"#Create a local directory and download the BLOB from the container to a local directory$destination="C:\Test"New-item-path$destination-itemtype Directory- Force$blobs| Get-azurestorageblobcontent-destination$DestinationFolder-context$Ctx
Chinese version of Windows Azure, run the appropriate command to add parameters -environment Azurechinacloud , such as:
Add-azureaccount-environment Azurechinacloud
Summarize common commands for PowerShell