Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Extract Variables in Powershell

$
0
0

Hi,

I try to calculate disk usage but stuck how to extract data from a recordset:

The command:

$Capacity = Get-ClusterSharedVolume -Cluster "Clus1" | select -Expand SharedVolumeInfo | select @{e={($_.Partition.Size)}} | Out-String
$UsedDisksize = Get-ClusterSharedVolume -Cluster "Clus1" | select -Expand SharedVolumeInfo | select @{e={$_.Partition.UsedSpace}} | Out-String

delivers the following Output: (2 different Cluster Shared Volumes are present)

($_.Partition.Size)
-------------------
966230274048
966230274048

$_.Partition.UsedSpace
----------------------
610945425408
731332595712

How can I separate These Values in  $Capacity and $UsedDisksize that I can do further calculation in a foreach loop?

Thanks in Advance,

Markus


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>