NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform.
You will still be able to view content, but posting and replying will be temporarily disabled.
To learn more, please review the information in this blog post.

General Discussion

Powershell Question

Terrydari123
2,582 Views

I need to find the space used by only a select group of volumes. 

PS C:\WINDOWS\system32> Get-NcVol | Where-Object { $_.State -eq 'offline'} |  ( ????) 

 

 

What command can I use to get the total space used by only the offine volumes?

Thanks

1 ACCEPTED SOLUTION

donny_lang
2,568 Views

You got it about 95% of the way there. I would do:

 

 Get-NcVol | Where-Object {$_.State -eq "offline"} | select Name, @{l = "TotalSizeGB"; e = {$([Math]::Round($_.TotalSize / 1GB, 2))}}

It'll return something like this:

 

Name         TotalSizeGB
----         -----------
testvol         250

The TotalSize is reported in bytes, so I'm just using a calculated property to convert it back to GB for readability's sake. 

View solution in original post

1 REPLY 1

donny_lang
2,569 Views

You got it about 95% of the way there. I would do:

 

 Get-NcVol | Where-Object {$_.State -eq "offline"} | select Name, @{l = "TotalSizeGB"; e = {$([Math]::Round($_.TotalSize / 1GB, 2))}}

It'll return something like this:

 

Name         TotalSizeGB
----         -----------
testvol         250

The TotalSize is reported in bytes, so I'm just using a calculated property to convert it back to GB for readability's sake. 

Public