Files in the OneDrive sync folder with the "Files on Demand" feature make use of a number of specific attribute bits, such as:
0x00000200 | SparseFile
0x00000400 | ReparsePoint
0x00001000 | Offline
0x00080000 | Pinned
0x00100000 | Unpinned
(non-exhaustive list)
In PowerShell 6.1, some of the bits are masked out, so code that runs in Windows PowerShell 5.1 will not run correctly under PowerShell 6.1.
(this might be related to underlying .NET Core behavior, but the PS6 user… doesn't care ;-) )
Steps to reproduce
Run the following commands under PowerShell 6.1:
"'{0:x}' -f (gi 'C:\Users\steph\OneDrive\Always keep on this device.txt').Attributes
"'{0:x}' -f (gi 'C:\Users\steph\OneDrive\Free up space.txt').Attributes
Expected behavior
The output should be:
like in Windows PowerShell 5.1.
Actual behavior
Instead, PowerShell 6.1 outputs:
Environment data
Name Value
---- -----
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.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
Files in the OneDrive sync folder with the "Files on Demand" feature make use of a number of specific attribute bits, such as:
0x00000200 | SparseFile
0x00000400 | ReparsePoint
0x00001000 | Offline
0x00080000 | Pinned
0x00100000 | Unpinned
(non-exhaustive list)
In PowerShell 6.1, some of the bits are masked out, so code that runs in Windows PowerShell 5.1 will not run correctly under PowerShell 6.1.
(this might be related to underlying .NET Core behavior, but the PS6 user… doesn't care ;-) )
Steps to reproduce
Run the following commands under PowerShell 6.1:
Expected behavior
The output should be:
like in Windows PowerShell 5.1.
Actual behavior
Instead, PowerShell 6.1 outputs:
Environment data