【发布时间】:2019-02-02 15:28:15
【问题描述】:
在 Azure 门户中,在磁盘(托管磁盘)边栏选项卡下,有一个名为“磁盘状态”的列标题
这显示为附加或未附加。
我想运行一个脚本来显示我订阅中的所有未附加磁盘,以便我可以删除它们。
运行 cmdlet
get-azurermdisk
这给了我所有的磁盘,但是我如何获得显示磁盘状态的参数?
Get-member 显示一堆属性,但不显示磁盘状态。
TypeName: Microsoft.Azure.Commands.Compute.Automation.Models.PSDiskList
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToPSDisk Method Microsoft.Azure.Commands.Compute.Automation.Models.PSDisk ToPSDisk()
ToString Method string ToString()
Validate Method void Validate()
CreationData Property Microsoft.Azure.Management.Compute.Models.CreationData CreationData {get;set;}
DiskSizeGB Property System.Nullable[int] DiskSizeGB {get;set;}
EncryptionSettings Property Microsoft.Azure.Management.Compute.Models.EncryptionSettings EncryptionSettings {get;set;}
Id Property string Id {get;}
Location Property string Location {get;set;}
ManagedBy Property string ManagedBy {get;}
Name Property string Name {get;}
OsType Property System.Nullable[Microsoft.Azure.Management.Compute.Models.OperatingSystemTypes] OsType {get;set;}
ProvisioningState Property string ProvisioningState {get;}
ResourceGroupName Property string ResourceGroupName {get;}
Sku Property Microsoft.Azure.Management.Compute.Models.DiskSku Sku {get;set;}
Tags Property System.Collections.Generic.IDictionary[string,string] Tags {get;set;}
TimeCreated Property System.Nullable[datetime] TimeCreated {get;}
Type Property string Type {get;}
Zones Property System.Collections.Generic.IList[string] Zones {get;set;}
【问题讨论】:
标签: azure powershell