try using a literal path
This commit is contained in:
@@ -804,9 +804,10 @@ Function Get-FileSizes {
|
||||
}
|
||||
|
||||
# Get the file paths and sizes as specified
|
||||
$FileSizes = Get-ChildItem $Path -Recurse:$Recurse -Force:$IncludeHidden -ErrorAction SilentlyContinue | `
|
||||
$FileSizes = Get-ChildItem -LiteralPath "\\?\${Path}" -Recurse:$Recurse -Force:$IncludeHidden -ErrorAction SilentlyContinue | `
|
||||
Where-Object { ! $_.PSIsContainer -and ($_.FullName.Length -lt 260)} | `
|
||||
Sort-Object -Descending:$SortOrder -Property Length | `
|
||||
Select-Object -First $Quantity @{Name="File Path";Expression={$_.DirectoryName + '\' + $_.Name}}, @{Name=$UnitLabel;Expression={[Math]::Round($_.Length / $Divisor, $Precision)}}
|
||||
Select-Object -First $Quantity @{Name="File Path";Expression={[IO.Path]::Combine($_.DirectoryName, $_.Name)}}, @{Name=$UnitLabel;Expression={[Math]::Round($_.Length / $Divisor, $Precision)}}
|
||||
|
||||
# Set output prefix
|
||||
$prefix = "The ${Quantity} " + $PSCmdlet.ParameterSetName + " files found at ""${Path}"""
|
||||
|
||||
Reference in New Issue
Block a user