From f0264d0147b76649fb05d0b404aeec4d2bc84208 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL)" Date: Sat, 30 Mar 2019 08:40:32 -0700 Subject: [PATCH] add support for NTFS streams syntax --- .../namespaces/FileSystemProvider.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index bae300d570..8454a8c1e8 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -142,6 +142,14 @@ namespace Microsoft.PowerShell.Commands // This handles the trailing slash case continue; } +#if !UNIX + else if (item.Contains(":")) + { + // This handles the NTFS stream name + var streamName = item.Split(":"); + exactPath = Directory.GetFileSystemEntries(exactPath, streamName[0]).First() + ":" + streamName[1]; + } +#endif else { exactPath = Directory.GetFileSystemEntries(exactPath, item).First();