fix casing for supplied path

This commit is contained in:
2024-08-08 15:36:26 -04:00
parent 11317ef618
commit efea29ac95
+10
View File
@@ -770,6 +770,16 @@ Function Get-FileSizes {
[string]$Units,
[int]$Precision=2
)
# Fix drive case so output looks nicer
Switch ( $Path.Length ) {
1 { $Path = $Path.ToUpper() }
{ $_ -gt 1 } {
$split = $Path.Split(":")
$Path = $split[0].ToUpper() + ":"
If ( $split[1] ) { $Path += $split[1] }
}
}
# If no path is specified, set $Path to the directory containing user profiles
If (-not $Path ) {