Hi, i hav a command that gets the ram memory of the servers in GB
$RAM = Get-WMIObject -class Win32_PhysicalMemory -computername $server | Measure-Object -Property capacity -Sum | select @{N="Ram"; E={[math]::round(($_.Sum / 1GB),2)}}
The problem is that one of the servers has 256 GB but powershell commands gets 255.99
Having this figure breaks another part of the script.
Ho i want the regex to only show 255 instead of 255.99
I can do a replace the dot with:
$ram = $ram.Ram -replace '\.', ' '
But how can i get rid of everything after the dot so it only shows 255?
Thanks