Steps to reproduce
Get-ChildItem -Recurse $env:OneDrive
with PowerShell Core 6.2.0 outputs the same results as:
Get-ChildItem $env:OneDrive
In other words, the subfolders are not recursed into.
This can be verified easily with:
PS C:/Users/steph> (Get-ChildItem $env:OneDrive).Count
174
PS C:/Users/steph> (Get-ChildItem -Recurse $env:OneDrive).Count
174
This works properly with Windows PowerShell 5.1:
PS C:/Users/steph> (Get-ChildItem $env:OneDrive).Count
174
PS C:/Users/steph> (Get-ChildItem -Recurse $env:OneDrive).Count
158122
Expected behavior
Get-ChildItem -Recurse $env:OneDrive
should enumerate all files and folders in the OneDrive sync tree.
Actual behavior
Get-ChildItem -Recurse $env:OneDrive
enumerates only the files and folders at the root of the OneDrive sync tree.
Environment data
PS C:/Users/steph> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.0
PSEdition Core
GitCommitId 6.2.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:/Users/steph> (gi "C:\Users\steph\AppData\Local\Microsoft\OneDrive\OneDrive.exe").VersionInfo
ProductVersion FileVersion FileName
-------------- ----------- --------
19.043.0304.0007 19.043.0304.0007 C:\Users\steph\AppData\Local\Microsoft\OneDrive\OneDrive.exe
OS Version: 10.0.17763.437
Steps to reproduce
with PowerShell Core 6.2.0 outputs the same results as:
In other words, the subfolders are not recursed into.
This can be verified easily with:
This works properly with Windows PowerShell 5.1:
Expected behavior
should enumerate all files and folders in the OneDrive sync tree.
Actual behavior
enumerates only the files and folders at the root of the OneDrive sync tree.
Environment data
OS Version: 10.0.17763.437