本文主要介绍Windows Azure Powershell对ASM资源的基本操作

1.登陆ASM模式,命令:Add-AzureAccount -Environment AzureChinaCloud

2.获取订阅信息,命令:Get-AzureSubscription

3.设置指定的操作订阅及指定的存储账号,命令:

Set-AzureSubscription -SubscriptionId “******” -CurrentStorageAccountName “******”

Select-AzureSubscription -SubscriptionId "******" -Current

4.查看默认的操作订阅或当前的操作订阅,命令:

Get-AzureSubscription -Current
    Get-AzureSubscription -Default

5.获取虚拟机的信息,命令:Get-AzureVM

6.获取存储账号的信息,命令:Get-AzureStorageAccount

7.获取自动化服务的信息,命令:Get-AzureAutomationAccount

8.查询一个陌生的操作命令,示例:get-command get-azurev*

9.获取指定命令的操作手册,示例:Get-Help Get-AzureAutomationAccount -Full

备注:

a.有时安装完Windows Azure Powershell会出现一种比较奇怪的现象,确认已经成功安装了,命令也可以使用Tab键自动补齐,但没有相应的显示参数信息,例如:

PS C:\Users\stone> get-help Add-AzureAccount -full

名称
Add-AzureAccount 语法 参数
无 输入
无 输出
System.Object 别名
无 备注

b.出现上述情况后,需要将Azure模块导入当前操作的Powershell,命令:Import-Module -Name Azure;并可以查看当前Powershell所拥有的模块,命令:Get-Module

PS C:\Users\stone> Import-Module -Name Azure
PS C:\Users\stone> Get-Module ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 4.3.1 Azure {Add-AzureAccount, Add-AzureApplicationGatewaySslCertificate, Add-AzureCertificate, Add-AzureDataDisk...}
Manifest 3.3.1 Azure.Storage {Get-AzureStorageBlob, Get-AzureStorageBlobContent, Get-AzureStorageBlobCopyState, Get-AzureStorageContainer...}
Manifest 3.3.1 AzureRM.Profile {Add-AzureRmAccount, Add-AzureRmEnvironment, Disable-AzureRmDataCollection, Enable-AzureRmDataCollection...}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

c.再次运行预操作的命令,可以成功获取到其参数

PS C:\Users\stone> Add-AzureAccount -Environment AzureChinaCloud

Id                                                                                                                           Type
-- ----
WATSTest03@MicrosoftInternal.partner.onmschina.cn User PS C:\Users\stone> get-help Add-AzureAccount -full 名称
Add-AzureAccount 摘要
Adds the Azure account to Windows PowerShell 语法
Add-AzureAccount [-Environment <String>] [-Credential <PSCredential>] [-Profile <AzureProfile>] [<CommonParameters>] Add-AzureAccount [-Environment <String>] [-Credential <PSCredential>] -ServicePrincipal [<SwitchParameter>] -Tenant <String> [-Profile <AzureProfile>] [<CommonParameters>]

Azure Powershell对ASM资源的基本操作的更多相关文章

  1. Azure Powershell对ARM资源的基本操作

    本分主要介绍Windows Azure Powershell对ARM资源的基本操作 1.登陆ARM模式,命令:Login-AzureRmAccount -EnvironmentName AzureCh ...

  2. 通过Azure Powershell获取asm及arm虚拟机的配置信息

    1.asm虚拟机可以使用类似如下Azure Powershell命令获取虚拟机的基本信息,包括发行版本,虚拟机名称及size[备注:虚拟机需要是使用平台image创建的] PS C:\Users\he ...

  3. 使用 Azure PowerShell 将 IaaS 资源从经典部署模型迁移到 Azure Resource Manager

    以下步骤演示了如何使用 Azure PowerShell 命令将基础结构即服务 (IaaS) 资源从经典部署模型迁移到 Azure Resource Manager 部署模型. 也可根据需要通过 Az ...

  4. Azure RBAC管理ASM资源

    上一篇文章介绍了Azure基于ARM的RBAC,给不同的用户分配不同的权限. 但目前在国内使用的大部分用户还是以ASM的资源为主.比如:VM.Storage.Network.WebAPP.SQL Az ...

  5. Azure CLI对ASM,ARM资源的基本操作

    本文主要介绍Windows Azure CLI对ASM及ARM资源的基本操作 1.在windows的CMD或Powershell环境下,输入命令:azure,可以查看到当前操作的模式为ASM还是ARM ...

  6. Azure PowerShell (14) 批量导出Azure ASM ACL和ARM NSG配置信息

    <Windows Azure Platform 系列文章目录> 最近有一个客户需求,需要批量导出Azure Classic VM的ACL (Access Control List), 还有 ...

  7. Azure PowerShell 1.0.0以上版本在中国Azure使用的注意事项

    随着Azure PowerShell 1.0.0+的推出,越来越多的客户开始使用新的版本的Azure PowerShell.此版本的PowerShell最大的改变在于将原先的Switch-AzureM ...

  8. 使用 Azure CLI 将 IaaS 资源从经典部署模型迁移到 Azure Resource Manager 部署模型

    以下步骤演示如何使用 Azure 命令行接口 (CLI) 命令将基础结构即服务 (IaaS) 资源从经典部署模型迁移到 Azure Resource Manager 部署模型. 本文中的操作需要 Az ...

  9. Azure PowerShell (一)如何安装和配置 Azure PowerShell

    什么是 Azure PowerShell? Azure PowerShell 是一组模块,提供用于通过 Windows PowerShell 管理 Azure 的 cmdlet.你可以使用 cmdle ...

随机推荐

  1. opacity的背景透明&background中rgba的背景色透明

    近期使用css实现了一个loading旋转加载的图片效果,类似gif动画 过程中,需要透明背景,但是图片不要透明 只要背景透明!只要背景透明!只要背景透明! 这里对透明模糊了,两种写法,模糊了 A: ...

  2. Android Studio 查看手机CPU信息

    在Android开发中,我们想要获取手机是什么CPU架构,可以通过下面方式: 1.进入adb 终端 adb shell 2.进入proc目录 cd /proc/ 3.查看cpu信息 cat cpuin ...

  3. 模拟winform里的控件的事件和委托机制

    参考:.NET 中的委托 委托的两大用处 1.委托可以实现方法作为参数进行传递,如 /// <summary> /// the English speaker. /// </summ ...

  4. 【知了堂学习笔记】/JavaScript对象--/暖妮

    JavaScript对象 1.什么是JavaScript对象? JavaScript 中的所有事物都是对象:字符串.数字.数组.日期,等等. 在 JavaScript 中,对象是拥有属性和方法的数据. ...

  5. 移动端js调取手机相册和拍照功能

    前端可以通过js调取手机的相册和拍照功能,但不能拍视频!!! <!DOCTYPE html> <html lang="en"> <head> & ...

  6. python 组合样例

    class Bill(): def __init__(self, description): self.description = description class Tail(): def __in ...

  7. Zabbix实战-简易教程(7)--监控第一台host

    一.安装 agent 1.1 Agent分布 1.2 Agent安装 基础模板安装方法: wget -qO- http://zbxinstall.168.com:18888/base/agent-in ...

  8. java_web学习(六) request对象中的get和post差异

    1.get与post的区别 Get和Post方法都是对服务器的请求方式,只是他们传输表单的方式不一样. 下面我们就以传输一个表单的数据为例,来分析get与Post的区别 1.1 get方法  jsp中 ...

  9. 开发高性能JAVA应用程序基础(内存篇)

    虽然Java的垃圾回收和当前高配置的服务器可以让程序员大部分时间忘掉OutOfMemoryError的存在,但是访问量增大后频繁的GC会额外消耗CPU (使用top查看结果为us值高),系统响应速度下 ...

  10. 【margin和padding的区别】

    margin和padding的区别 margin是指从自身边框到另一个容器边框之间的距离,就是容器外距离.(外边距) padding是指自身边框到自身内部另一个容器边框之间的距离,就是容器内距离.(内 ...