fix casing for supplied path
This commit is contained in:
@@ -771,6 +771,16 @@ Function Get-FileSizes {
|
|||||||
[int]$Precision=2
|
[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 no path is specified, set $Path to the directory containing user profiles
|
||||||
If (-not $Path ) {
|
If (-not $Path ) {
|
||||||
$Path = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory)
|
$Path = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory)
|
||||||
|
|||||||
Reference in New Issue
Block a user