Azure Powershell获取Azure虚拟机的操作系统型号及具体版本
Azure ARM 模式虚拟机:
1.登陆Azure账号
Add-AzureRmAccount -EnvironmentName AzurechinaCloud
2.选择指定订阅
Select-AzureRmSubscription -Subscription ******
3.获取指定虚拟机信息
$vm = Get-AzureRmVM -ResourceGroupName ****** -Name ******
4.获取虚拟机操作系统型号及具体版本
Windows VM: PS C:\Users\he.liming> $vm = Get-AzureRmVM -ResourceGroupName hlmrgn -Name hlmwin12test
PS C:\Users\he.liming> $vm.StorageProfile.OsDisk.OsType
Windows
PS C:\Users\he.liming> $vm.StorageProfile.ImageReference
Publisher : MicrosoftWindowsServer
Offer : WindowsServer
Sku : 2012-R2-Datacenter
Version : latest
Id : Linux VM:
PS C:\Users\he.liming> $vm = Get-AzureRmVM -ResourceGroupName hlmrgn -Name hlmcent74n
PS C:\Users\he.liming> $vm.StorageProfile.OsDisk.OsType
Linux
PS C:\Users\he.liming> $vm.StorageProfile.ImageReference
Publisher : OpenLogic
Offer : CentOS
Sku : 7.4
Version : latest
Id :
5.上述4获取的虚拟机版本信息仅限于通过Azure镜像库创建的虚拟机,如果自定义上传VHD创建的虚拟机或使用捕获的Image创建的虚拟机无法获取到具体版本信息,只能获取到版本型号
PS C:\Users\he.liming> $vm = Get-AzureRmVM -ResourceGroupName hlmrgn -Name hlmtestn
PS C:\Users\he.liming> $vm.StorageProfile.OsDisk.OsType
Linux
PS C:\Users\he.liming> $vm.StorageProfile.ImageReference
Publisher :
Offer :
Sku :
Version :
Id : /subscriptions/6c87a588-88df-48ee-9e52-d04b06a8601f/resourceGroups/hlmrgn/providers/Microsoft.Compute/images/capture-hlmma69n2
Azure ASM 模式虚拟机:
1.登陆Azure账号
Add-AzureAccount -Environment AzureChinaCloud
2.获取当前操作的订阅信息
Get-AzureSubscription -Default
3.获取指定虚拟机信息
$vm = Get-AzureVM -ServiceName ****** -Name ******
4.获取虚拟机操作系统型号及具体版本
PS C:\Users\he.liming> $vm = Get-AzureVM -ServiceName hlmtest1 -Name hlmsct2
PS C:\Users\he.liming> $vm.VM.OSVirtualHardDisk.os
Linux
PS C:\Users\he.liming> $vm.VM.OSVirtualHardDisk.SourceImageName
f1179221e23b4dbb89e39d70e5bc9e72__OpenLogic-CentOS-73-20170925
Azure Powershell获取Azure虚拟机的操作系统型号及具体版本的更多相关文章
- Windows 上安装 Azure PowerShell及Azure PowerShell部署虚拟机
一.Azure PowerShell部署 1.使用 PowerShellGet 在 Windows 上安装 Azure PowerShell 从 Azure PowerShell 版本 6.0 开 ...
- 使用PowerShell 获取azure image publisher offer sku 信息
使用azure powershell 获取指定区域的可用镜像 publisher offer sku信息 param ( [parameter(Mandatory = $false)] $Locati ...
- 如何使用 Azure PowerShell 在 Azure Marketplace 中查找 Windows VM 映像
本主题介绍如何使用 Azure PowerShell 在 Azure Marketplace 中查找 VM 映像. 创建 Windows VM 时使用此信息来指定 Marketplace 映像. 确保 ...
- 通过Azure Powershell获取asm及arm虚拟机的配置信息
1.asm虚拟机可以使用类似如下Azure Powershell命令获取虚拟机的基本信息,包括发行版本,虚拟机名称及size[备注:虚拟机需要是使用平台image创建的] PS C:\Users\he ...
- 使用 Azure PowerShell 管理 Azure 虚拟网络和 Windows 虚拟机
Azure 虚拟机使用 Azure 网络进行内部和外部网络通信. 本教程介绍了如何在虚拟网络中创建多个虚拟机 (VM),以及如何在虚拟机之间配置网络连接. 你将学习如何执行以下操作: 创建虚拟网络 创 ...
- azure powershell 获取可用镜像列表
通过Azure Powershell 指定location和Pbulishername 获取所有可用镜像的 publisherName,Offer,Skus,Version,location信息列表 ...
- [New Portal]Windows Azure Virtual Machine (16) 使用Azure PowerShell创建Azure Virtual Machine
<Windows Azure Platform 系列文章目录> 注:本章内容和之前的[New Portal]Windows Azure Virtual Machine (12) 在本地制作 ...
- Azure Powershell获取指定订阅下的虚拟机信息(ARM)
为方便Azure用户导出已创建虚拟机的相关信息,特编写如下脚本: 详情脚本: # 登陆Azure Account Add-AzureRmAccount -EnvironmentName AzureCh ...
- Azure Powershell获取指定订阅下的虚拟机信息(ASM)
为方便Azure用户导出已创建虚拟机的相关信息,特编写如下脚本: 详情脚本: # 登陆Azure Account Add-AzureAccount -Environment AzureChinaClo ...
随机推荐
- faster-rcnn目录介绍
data 用来存放pretrained模型,比如imagenet上的,以及读取文件的cache缓存 experiments 存放配置文件以及运行的log文件,另外这个目录下有scripts可以用end ...
- 嵌套列表的加权和 · Nested List Weight Sum
[抄题]: Given a nested list of integers, return the sum of all integers in the list weighted by their ...
- Logger Rate Limiter 十秒限时计数器
[抄题]: Design a logger system that receive stream of messages along with its timestamps, each message ...
- HTTP协议简析(二)
HTTP响应也包含四部分内容: 响应行: 协议版本:HTTP/1.1 状态码:200 状态描述:对状态码的说明 响应头:用来规范数据,常用的有: server:服务器信息 date:响应的时间 las ...
- spring4-2-bean配置-6-使用外部属性文件
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAk0AAAFGCAIAAAD4tzxRAAAgAElEQVR4nO2d27HsOm+tOxWn4CeXAm ...
- Greeplum 系列(六) 备份与恢复
Greeplum 系列(六) 备份与恢复 http://www.dbdream.com.cn/category/greenplum/ 先介绍几个命令查看 Greenplum 集群状态: # 1. 查看 ...
- MapReduce的初次尝试
====前提: 搭建好集群环境(zookeeper.hadoop.hbase). 搭建方法这里就不进行介绍了,网上有很多博客在介绍这些. ====简单需求: WordCount单词计数,号称Hadoo ...
- hdu 4946 Area of Mushroom (凸包,去重点,水平排序,留共线点)
题意: 在二维平面上,给定n个人 每个人的坐标和移动速度v 若对于某个点,只有 x 能最先到达(即没有人能比x先到这个点或者同时到这个点) 则这个点称作被x占有,若有人能占有无穷大的面积 则输出1 , ...
- cookie与session组件
会话跟跟踪技术 cookie介绍 Djanjo中操作Cookle Session Django中Session相关方法 Django中的Session配置 CBV中加装饰器 session中运用aja ...
- command >/dev/null 2>&1 解说
0:表示键盘输入(stdin)1:表示标准输出(stdout),系统默认是1 2:表示错误输出(stderr) command >/dev/null 2>&1 & == ...