cleanup the path the user enters
This commit is contained in:
@@ -778,6 +778,17 @@ Function Get-FileSizes {
|
|||||||
$IncludeHidden = $false
|
$IncludeHidden = $false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If the path is not an absolute path, make it so
|
||||||
|
ElseIf ( -not (Test-Path $Path) ) {
|
||||||
|
$NewPath = $Path[0] + ":\"
|
||||||
|
If ( -not (Test-Path $NewPath) ) {
|
||||||
|
Write-Error "Could not find path: ${Path}"
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
$Path = $NewPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Change the sort order depending on which parameter set was specified
|
# Change the sort order depending on which parameter set was specified
|
||||||
Switch ( $PSCmdlet.ParameterSetName ) {
|
Switch ( $PSCmdlet.ParameterSetName ) {
|
||||||
"largest" { $SortOrder = $true ; $Quantity = $Largest }
|
"largest" { $SortOrder = $true ; $Quantity = $Largest }
|
||||||
|
|||||||
Reference in New Issue
Block a user