Ok, I am beginner - and lost with this:
I have an Array where some drive data from WMI are captured:
$drivedata = $Drives | select @{Name="Kapazit?t(GB)";Expression={$_.Kapazit?t}}
The Array has these values (2 drives):
@{Kapazit?t(GB)=1.500} @{Kapazit?t(GB)=1.500}
and just want to convert the 1.500 into a number 1500
I tried different suggestions I found here, but couldn't get it working:
-Replace ".","" and [int]
doesn't work.
I am not sure if regex would be correct and how to do this.
For help many thanks in advance.
question from:
https://stackoverflow.com/questions/25322636/powershell-convert-string-to-number 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…