Skip to content

Get-ChildItem -Recurse -Force Aborts With File Paths When Directory Structure Has At Least One Level Exactly Equal To MAX_PATH For Length - And Ignores ErrorAction Options / Introduced With PowerShell 7.2.0-preview.9 #16123

Closed

Description

@BouwenMA

Prerequisites

Steps to reproduce

I am trying to script to recursively search file systems, and 7.2 preview 9 aborts the Get-ChildItem command with file paths>MAX_PATH (260) chars. This issue does not happen with prior versions.

Example folder seen in Win 10 that will cause this:
"C:\ProgramData\Microsoft\Windows\Containers\BaseImages\61be50b1-e59b-45c7-9460-020d3f6bc848\BaseLayer\Files\Program Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1\Diagnostics\Simple"

  • Found initially when searching for files using: gci -Path C:\ -Recurse -Force -ErrorAction SilentlyContinue
  • The "Simple" child folder exceeds MAX_PATH (260) chars and is where it bombs out
  • It seems to ignore -ErrorAction SilentlyContinue

To rule out permission issues, I created a separate test folder structure on my D: drive with the same length and had the same results with it:

B:\Batch>mkdir "\\?\D:\DrogramTest\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1\Diagnostics\Simple"

B:\Batch>dir "\\?\D:\DrogramTest\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program Files  (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1\Diagnostics\Simple"
 Volume in drive \\?\D: is Toshiba5TB
 Volume Serial Number is 625A-B5E5

 Directory of \\?\D:\DrogramTest\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1\Diagnostics\Simple

2021.09.19  18:23    <DIR>          .
2021.09.19  18:23    <DIR>          ..
               0 File(s)              0 bytes

Simply then attempting gci D:\DrogramTest -Recurse -Force will result in it aborting with the error.

Expected behavior

Behavior With 7.2.0 Preview 8 (and prior versions)

PowerShell 7.2.0-preview.8
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS B:\PSH\PowerShell-7.2.0-preview.8-win-x64> Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1\" -Recurse -ErrorAction SilentlyContinue -Force

    Directory:
C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program
Files
(x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          2021.05.22    09:54                Diagnostics

    Directory:
C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program
Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics
\1.0.1\Diagnostics

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          2021.05.22    09:54                Simple

PS B:\PSH\PowerShell-7.2.0-preview.8-win-x64>

Actual behavior

Behavior With 7.2.0 Preview 9

PowerShell 7.2.0-preview.9
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS B:\PSH\PowerShell-7.2.0-preview.9-win-x64> Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1\" -Recurse -ErrorAction SilentlyContinue -Force

    Directory:
C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program
Files
(x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics\1.0.1

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          2021.05.22    09:54                Diagnostics

    Directory:
C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program
Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics
\1.0.1\Diagnostics

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          2021.05.22    09:54
Get-ChildItem: The system cannot find the path specified.

PS B:\PSH\PowerShell-7.2.0-preview.9-win-x64>

Error details

PS B:\> Get-Error

Exception             :
    Type            : System.ComponentModel.Win32Exception
    NativeErrorCode : 3
    ErrorCode       : -2147467259
    TargetSite      :
        Name          : IsReparsePointLikeSymlink
        DeclaringType : Microsoft.PowerShell.Commands.InternalSymbolicLinkLinkCodeMethods
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Message         : The system cannot find the path specified.
    Source          : System.Management.Automation
    HResult         : -2147467259
    StackTrace      :
   at Microsoft.PowerShell.Commands.InternalSymbolicLinkLinkCodeMethods.IsReparsePointLikeSymlink(FileSystemInfo
fileInfo) in System.Management.Automation.dll:token 0x60016fa+0x6d
   at Microsoft.PowerShell.Commands.FileSystemProvider.Dir(DirectoryInfo directory, Boolean recurse, UInt32 depth,
Boolean nameOnly, ReturnContainers returnContainers, InodeTracker tracker) in System.Management.Automation.dll:token
0x6001657+0x31b
   at Microsoft.PowerShell.Commands.FileSystemProvider.Dir(DirectoryInfo directory, Boolean recurse, UInt32 depth,
Boolean nameOnly, ReturnContainers returnContainers, InodeTracker tracker) in System.Management.Automation.dll:token
0x6001657+0x34f
   at Microsoft.PowerShell.Commands.FileSystemProvider.GetPathItems(String path, Boolean recurse, UInt32 depth,
Boolean nameOnly, ReturnContainers returnContainers) in System.Management.Automation.dll:token 0x6001656+0x5a
   at Microsoft.PowerShell.Commands.FileSystemProvider.GetChildItems(String path, Boolean recurse, UInt32 depth) in
System.Management.Automation.dll:token 0x6001653+0x0
   at System.Management.Automation.SessionStateInternal.GetChildItems(CmdletProvider providerInstance, String path,
Boolean recurse, UInt32 depth, CmdletProviderContext context) in System.Management.Automation.dll:token 0x6003a8e+0x7
CategoryInfo          : NotSpecified: (:) [Get-ChildItem], Win32Exception
FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.GetChildItemCommand
InvocationInfo        :
    MyCommand        : Get-ChildItem
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 1
    Line             : Get-ChildItem -Path
"C:\ProgramData\Microsoft\Windows\Containers\BaseImages\283a08b6-ccbf-4c2d-a79e-cab35a294e78\BaseLayer\Files\Program
Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Test\Modules\Example2.Diagnostics
\1.0.1\" -Recurse -ErrorAction SilentlyContinue -Force
    PositionMessage  : At line:1 char:1
                       + Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Containers\Base …
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Get-ChildItem
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.9
PSEdition                      Core
GitCommitId                    7.2.0-preview.9
OS                             Microsoft Windows 10.0.21390
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Activity

  1. added
    Needs-Triage
    on Sep 19, 2021
  2. iSazonov commented on Sep 20, 2021

    @iSazonov
    Collaborator

    Please load latest daily build from https://github.com/PowerShell/PowerShell and check again.

    GitHub
    PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.
  3. added
    Area-FileSystem-Provider
    on Sep 20, 2021
  4. changed the title [-]Get-ChildItem -Recurse -Force Aborts With File Paths Longer Than MAX_PATH And Ignores ErrorAction Options / Introduced With PowerShell 7.2.0-preview.9[/-] [+]Get-ChildItem -Recurse -Force Aborts With File Paths When Directory Structure Has At Least One Level Exactly Equal To MAX_PATH For Length - And Ignores ErrorAction Options / Introduced With PowerShell 7.2.0-preview.9[/+] on Sep 25, 2021
  5. BouwenMA commented on Sep 25, 2021

    @BouwenMA
    Author

    I tested with the latest daily as suggested. The results were the same when using the commands I showed above for recreating the condition.

    With more testing today, I found that this only occurs if the length of one of the directories is exactly equal to MAX_PATH. Anything less or greater does not result in this issue. It just so happens that the C:\ProgramData structure I first found this with, as well as the example folder I created above, had a path where one of the child folders came to exactly 260 chars. I updated the title today of this issue to better indicate the problem.

    I created a quick script that can be used to show this in action, and allow easily running from different PS versions called "ShowPSH_Bug.ps1" with the contents listed below:

    "ShowPSH_Bug.ps1"

    # Show the PowerShell Version
    $PSVersionTable.PSVersion.ToString()
    
    # Pick top level to create test folder
    $Base = $ENV:USERPROFILE
    # Generate name for long test folder to create that is close to MAX_PATH, but under, leaving room to create child folders
    $FoldParent = "A" * (260 - $Base.Length - 9 - 2)  # 9 = "Fold03Bad" length and 2 = 2x "\"
    
    # Create test folder structure, with a "SubFolder" underneath each test child folder
    Cmd.exe /C MkDir "\\?\$Base\$FoldParent\Fold01Good\SubFolder"	# Parent of "SubFolder" Will be 261 chars long
    Cmd.exe /C MkDir "\\?\$Base\$FoldParent\Fold02Good02"	        # Folder Will be 263 chars long - No subfolders created
    Cmd.exe /C MkDir "\\?\$Base\$FoldParent\Fold03OK\SubFolder"	# Parent of "SubFolder" Will be 259 chars long
    Cmd.exe /C MkDir "\\?\$Base\$FoldParent\Fold04Bad\SubFolder"	# Parent of "SubFolder" Will be exactly 260 chars long (MAX_PATH) - This will be the problematic one!
    Cmd.exe /C MkDir "\\?\$Base\$FoldParent\Fold05___OK\SubFolder"	# Parent of "SubFolder" Will be 262 chars long
    
    # Now Perform First Test - Simply Using Get-ChildItem To Display The Output
    Write-Host("`r`nTest One: gci")
    # With PSH 7.2 preview 9 and newer this bombs out right when enumerating the "Fold04Bad" folder
    Get-ChildItem -Recurse -Force -ErrorAction SilentlyContinue "$Base\$FoldParent"
    
    # Now Perform Second Test - Using Get-ChildItem Piping To ForEach-Object
    Write-Host("`r`nTest Two: gci + ForEach")
    Get-ChildItem -Recurse -Force -ErrorAction SilentlyContinue -Path "$Base\$FoldParent" | ForEach-Object {
    	# With PSH 7.2 preview 9 and newer this bombs out right when enumerating the "Fold04Bad" folder, aborting the ForEach, and ignoring the ErrorAction
    	"Curr Folder: $($_.Name)"
    }
    
    # Remove the test folder structure
    Write-Host("Removing test folder structure...")
    Cmd.exe /C RD /S /Q "\\?\$Base\$FoldParent"
    
    

    I ran that script above in several PS versions, and pasted results below to show how the latest preview 9 and newer seem to have introduced an issue when this scenario occurs.

    Output for PowerShell 7.2 preview 8 (I also validated PowerShell 7.1.4 matched this)

    PS C:\> Z:\ShowPSH_Bug.ps1
    7.2.0-preview.8
    
    Test One: gci
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:55                Fold01Good
    d----          2021.09.25    01:55                Fold02Good02
    d----          2021.09.25    01:55                Fold03OK
    d----          2021.09.25    01:55                Fold04Bad
    d----          2021.09.25    01:55                Fold05___OK
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA\Fold01Good
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:55                SubFolder
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA\Fold03OK
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:55                SubFolder
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA\Fold04Bad
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:55                SubFolder
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA\Fold05___OK
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:55                SubFolder
    
    Test Two: gci + ForEach
    Curr Folder: Fold01Good
    Curr Folder: Fold02Good02
    Curr Folder: Fold03OK
    Curr Folder: Fold04Bad
    Curr Folder: Fold05___OK
    Curr Folder: SubFolder
    Curr Folder: SubFolder
    Curr Folder: SubFolder
    Curr Folder: SubFolder
    Removing test folder structure...
    
    PS C:\>
    

    Output for PowerShell 7.2 preview 9 and newer including latest daily

    
    PS C:\> Z:\ShowPSH_Bug.ps1
    7.2.0-daily20210923.1
    
    Test One: gci
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:56                Fold01Good
    d----          2021.09.25    01:56                Fold02Good02
    d----          2021.09.25    01:56                Fold03OK
    d----          2021.09.25    01:56
    d----          2021.09.25    01:56                Fold05___OK
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA\Fold01Good
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:56                SubFolder
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAA\Fold03OK
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d----          2021.09.25    01:56                SubFolder
    Get-ChildItem: Z:\ShowPSH_Bug.ps1:19
    Line |
      19 |  Get-ChildItem -Recurse -Force -ErrorAction SilentlyContinue "$Base\$F …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | The system cannot find the path specified.
    
    
    Test Two: gci + ForEach
    Curr Folder: Fold01Good
    Curr Folder: Fold02Good02
    Curr Folder: Fold03OK
    Curr Folder: Fold04Bad
    Curr Folder: Fold05___OK
    Curr Folder: SubFolder
    Curr Folder: SubFolder
    Get-ChildItem: Z:\ShowPSH_Bug.ps1:23
    Line |
      23 |  Get-ChildItem -Recurse -Force -ErrorAction SilentlyContinue -Path "$B …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | The system cannot find the path specified.
    
    Removing test folder structure...
    
    PS C:\>
    
    

    Above it can be seen that preview 9 and newer abort when attempting to enumerate the "Fold04Bad" folder structure for the simple gci recurse operation.
    Notice also in the fist part of the gci output above, where it lists the first set of folders before it starts recursing, that the listing has the placeholder with date/time stamp for the "Fold04Bad" folder, but the name is missing from the list... as seen in this excerpt here:

    d----          2021.09.25    01:56                Fold03OK
    d----          2021.09.25    01:56
    d----          2021.09.25    01:56                Fold05___OK
    
    

    When attempting to pipe the gci to ForEach-Object, the failure completely aborts seemingly ignoring the specified ErrorAction, making the error more of a terminating error vs non-terminating.

    PS 5.1 Behavior

    It should be noted that PS 5.1 does not enumerate the folders longer than MAX_PATH. However, as long as I use the ErrorAction shown, it at least continues with the operation and does not abort it:

    PS C:\> Z:\ShowPSH_Bug.ps1
    5.1.19041.1237
    
    Test One: gci
    
    
        Directory: C:\Users\matt\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d-----        2021.09.25     02:21                Fold01Good
    d-----        2021.09.25     02:21                Fold02Good02
    d-----        2021.09.25     02:21                Fold03OK
    d-----        2021.09.25     02:21                Fold04Bad
    d-----        2021.09.25     02:21                Fold05___OK
    
    Test Two: gci + ForEach
    Curr Folder: Fold01Good
    Curr Folder: Fold02Good02
    Curr Folder: Fold03OK
    Curr Folder: Fold04Bad
    Curr Folder: Fold05___OK
    Removing test folder structure...
    
    
    PS C:\>
    

    To confirm I removed the -ErrorAction and ran again in 5.1.. Where I saw an error displayed for each folder as it tried to enumerate... However it still didn't completely abort the operation trying either as seen with preview 9 and newer of 7.2.

  6. iSazonov commented on Sep 27, 2021

    @iSazonov
    Collaborator

    Mathias (@BouwenMA) Thanks for your investigations!

    The fix is easy. In:

    if (fullPath.Length > MAX_PATH)
    {
    fullPath = PathUtils.EnsureExtendedPrefix(fullPath);
    }

    we should replace the condition with if (fullPath.Length >= MAX_PATH).

  7. added
    Issue-Bug
    Up-for-Grabs
    on Sep 27, 2021
  8. removed
    Needs-Triage
    on Sep 27, 2021
  9. ghost added
    In-PR
    on Nov 18, 2021
  10. ghost removed
    In-PR
    on Nov 19, 2021
  11. ghost added
    Resolution-Fixed
    on Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FileSystem-ProviderIssue-BugResolution-FixedUp-for-Grabs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions