convert MB to GB in powershell code example
Example 1: powershell bytes to mb
$window.FindName("TargetSizeKB").Text = "500"
$sizeKB = $window.FindName("TargetSizeKB").Text -as [int]
# Umrechnung in MB
$sizeBytes = $sizeKB * 1000
Example 2: powershell convert text 20MB to bytes
$str = '3GB'
$int64 = [int64]$str.Replace('GB','') * 1GB