Microsoft Virtualization Discussions

How to Get a value from Get-NcVolSize

AllenChang
1,438 Views

I want to calculate the volume size,

so I need to get a value of [VolumeSize]

When I use GetNcVolSize,

It can not return me a size number,

It always return very much information

PS C:\Users\Administrator> Get-NcVolSize -VserverContext svm1 -Name svm1_root


NcController : 20.1.1.1
VolumeSize : 20971520
IsReadOnlyFlexVol : False
IsReplicaFlexVol : False
IsFixedSizeFlexVol : False

 

How can must I do that I can get the number [20971520] only?

 

1 ACCEPTED SOLUTION

mbeattie
1,371 Views

Hi Allen,

 

You can select and expand an individual property of the object. EG:

 

$volSizeGB = ((Get-NcVolSize -VserverContext svm1 -Name volume1 | Select-Object -ExpandProperty VolumeSize) / 1GB)

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

mbeattie
1,372 Views

Hi Allen,

 

You can select and expand an individual property of the object. EG:

 

$volSizeGB = ((Get-NcVolSize -VserverContext svm1 -Name volume1 | Select-Object -ExpandProperty VolumeSize) / 1GB)

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

AllenChang
1,365 Views

Thanks very much

Public