Summarize common commands for PowerShell

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.