From 38b195935460ad7445c5c71f073ff6b08bc55373 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 09:43:42 -0700 Subject: [PATCH 01/14] Update to .NET 5 preview 8 --- DotnetRuntimeMetadata.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index ffd8f438071..119291dccc5 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,8 +1,8 @@ { "sdk": { - "channel": "release/5.0.1xx-preview7", - "packageVersionPattern": "5.0.0-preview.7", - "sdkImageVersion": "5.0.100-preview.7", - "nextChannel": "net5/preview7" + "channel": "release/5.0.1xx-preview8", + "packageVersionPattern": "5.0.0-preview.8", + "sdkImageVersion": "5.0.100-preview.8", + "nextChannel": "net5/preview8" } } From 7d4d658345465640a0aa4076e8abb935b35b0658 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 09:53:26 -0700 Subject: [PATCH 02/14] Update powershell-win-core csproj --- .../powershell-win-core.csproj | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index f2c31f6ff22..5b91f0ab8b3 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -13,20 +13,13 @@ ..\..\assets\pwsh.manifest - - - Microsoft.NET.Sdk.WindowsDesktop - - - - - - - + true true + Windows + 7.0 @@ -64,4 +57,6 @@ + + From 6454dc33ff0a6bcf3176a834b784d3213111a2ed Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 09:53:37 -0700 Subject: [PATCH 03/14] Update GraphicalHost csproj --- .../Microsoft.PowerShell.GraphicalHost.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj index 466511d6d22..72eb8d6572f 100644 --- a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj +++ b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj @@ -1,4 +1,4 @@ - + Assembly containing WPF code for Out-GridView, HelpWindow, and Show-Command @@ -6,6 +6,8 @@ Microsoft.Management.UI.Internal Microsoft.PowerShell.GraphicalHost True + Windows + 7.0 From f69b73ad6325e2c6968824a97276366fa6133c66 Mon Sep 17 00:00:00 2001 From: James Truher Date: Fri, 21 Aug 2020 09:53:15 -0700 Subject: [PATCH 04/14] Add warning suppression for UTF7 encoding --- .../namespaces/FileSystemProvider.cs | 1 + src/System.Management.Automation/utils/EncodingUtils.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index c1a539fb3ac..8f3ea1a429d 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -7626,6 +7626,7 @@ public Encoding Encoding _encoding = value; // If an encoding was explicitly set, be sure to capture that. WasStreamTypeSpecified = true; +#pragma warning restore 612, 618 } } diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index abbe4a569f6..97838dffaa8 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -8,6 +8,7 @@ using System.Management.Automation.Internal; + namespace System.Management.Automation { internal static class EncodingConversion @@ -38,7 +39,9 @@ internal static class EncodingConversion { Default, ClrFacade.GetDefaultEncoding() }, { OEM, ClrFacade.GetOEMEncoding() }, { Unicode, System.Text.Encoding.Unicode }, +#pragma warning disable 612, 618 { Utf7, System.Text.Encoding.UTF7 }, +#pragma warning restore 612, 618 { Utf8, ClrFacade.GetDefaultEncoding() }, { Utf8Bom, System.Text.Encoding.UTF8 }, { Utf8NoBom, ClrFacade.GetDefaultEncoding() }, @@ -101,6 +104,7 @@ internal static void WarnIfObsolete(Cmdlet cmdlet, Encoding encoding) { cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); } +#pragma warning restore 612, 618 } } From 6cba7092782b766b89115013f8ad23ceacd6283a Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 10:58:38 -0700 Subject: [PATCH 05/14] Suppress UTF-7 obsoletion warnings --- .../namespaces/FileSystemProvider.cs | 5 ++--- src/System.Management.Automation/utils/EncodingUtils.cs | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 8f3ea1a429d..689a98b0239 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -7617,16 +7617,15 @@ public Encoding Encoding set { -#pragma warning disable 612, 618 +#pragma warning disable MSLIB0001 if (value == System.Text.Encoding.UTF7) -#pragma warning restore 612, 618 +#pragma warning restore MSLIB0001 { _provider.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); } _encoding = value; // If an encoding was explicitly set, be sure to capture that. WasStreamTypeSpecified = true; -#pragma warning restore 612, 618 } } diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index 97838dffaa8..cead7ec2442 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -39,9 +39,9 @@ internal static class EncodingConversion { Default, ClrFacade.GetDefaultEncoding() }, { OEM, ClrFacade.GetOEMEncoding() }, { Unicode, System.Text.Encoding.Unicode }, -#pragma warning disable 612, 618 +#pragma warning disable MSLIB0001 { Utf7, System.Text.Encoding.UTF7 }, -#pragma warning restore 612, 618 +#pragma warning restore MSLIB0001 { Utf8, ClrFacade.GetDefaultEncoding() }, { Utf8Bom, System.Text.Encoding.UTF8 }, { Utf8NoBom, ClrFacade.GetDefaultEncoding() }, @@ -98,13 +98,12 @@ internal static Encoding Convert(Cmdlet cmdlet, string encoding) /// The encoding to check for obsolescence. internal static void WarnIfObsolete(Cmdlet cmdlet, Encoding encoding) { -#pragma warning disable 612, 618 +#pragma warning disable MSLIB0001 if (encoding == System.Text.Encoding.UTF7) -#pragma warning restore 612, 618 +#pragma warning restore MSLIB0001 { cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); } -#pragma warning restore 612, 618 } } From 565ee1169290cccb2a7995a6505c4f8e75494523 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 11:01:58 -0700 Subject: [PATCH 06/14] Suppress BinaryFormatter obsoletion warnings --- .../FilterCore/FilterRules/FilterRuleExtensions.cs | 4 ++++ .../remoting/common/WireDataFormat/RemoteSessionCapability.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs index cb0a79de775..4a09321edb2 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs @@ -40,10 +40,14 @@ public static FilterRule DeepCopy(this FilterRule rule) FilterRule copy = null; try { +#pragma warning disable MSLIB0003 formatter.Serialize(ms, rule); +#pragma warning restore MSLIB0003 ms.Position = 0; +#pragma warning disable MSLIB0003 copy = (FilterRule)formatter.Deserialize(ms); +#pragma warning restore MSLIB0003 } finally { diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs index 86f43cbcc42..3c631c0f4ae 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs @@ -107,7 +107,9 @@ internal static byte[] GetCurrentTimeZoneInByteFormat() BinaryFormatter formatter = new BinaryFormatter(); using (MemoryStream stream = new MemoryStream()) { +#pragma warning disable MSLIB0003 formatter.Serialize(stream, TimeZoneInfo.Local); +#pragma warning restore MSLIB0003 stream.Seek(0, SeekOrigin.Begin); byte[] result = new byte[stream.Length]; stream.Read(result, 0, (int)stream.Length); From 2965760d15eb66ceb9a7e4554e219690a2f1239a Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 11:02:28 -0700 Subject: [PATCH 07/14] Upgrade project .NET to 5-preview.8 --- PowerShell.Common.props | 3 +++ global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 12 files changed, 29 insertions(+), 26 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 104f2f971d1..efeb970d059 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -110,6 +110,9 @@ ../signing/visualstudiopublic.snk true true + + + true diff --git a/global.json b/global.json index 8255d028e95..fe1d9f915f6 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.7.20366.15" + "version": "5.0.100-preview.8.20417.9" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index 67a70166185..4b04038e4af 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index efdd37f4223..8225e03452d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 6a0944359a0..09bb1c95a9a 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 45ed6de5124..6798baf83a3 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index fd826ae01af..a63b2596315 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index ae6bd145a5f..e0d81d95088 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 93950793985..97d0c463760 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 2948ec0696d..f9b93fa7756 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 46738ca931f..7630af87df9 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 8c5dcc0bb7e..6e5dc7b458b 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 3f2103658343fe2a04e37aaad8067a3ba1297d82 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 11:06:13 -0700 Subject: [PATCH 08/14] Suppress stackalloc in loop warnings --- .../commands/management/Process.cs | 2 ++ src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs | 2 ++ .../host/msh/ConsoleHostUserInterface.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index b825266e6ef..b05ce1e0e69 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -784,8 +784,10 @@ private static string RetrieveProcessUserName(Process process) // The buffer length must be +1, last position is for a null string terminator. int userNameLength = 257; int domainNameLength = 16; +#pragma warning disable CA2014 Span userNameStr = stackalloc char[userNameLength]; Span domainNameStr = stackalloc char[domainNameLength]; +#pragma warning restore CA2014 Win32Native.SID_NAME_USE accountType; // userNameLength and domainNameLength will be set to actual lengths. diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 0403fdf41f9..1fec13c464e 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -2576,7 +2576,9 @@ internal static void WriteConsole(ConsoleHandle consoleHandle, ReadOnlySpan outBufferLine = stackalloc char[outBuffer.Length + endOfLineLength]; +#pragma warning restore CA2014 outBuffer.CopyTo(outBufferLine); endOfLine.CopyTo(outBufferLine.Slice(outBufferLine.Length - endOfLineLength)); WriteConsole(consoleHandle, outBufferLine); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index b48af7eabbe..2d494cf701c 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -305,7 +305,9 @@ private object ReadLineSafe(bool isSecureString, char? printToken) ConsoleKeyInfo keyInfo = Console.ReadKey(true); #else const int CharactersToRead = 1; +#pragma warning disable CA2014 Span inputBuffer = stackalloc char[CharactersToRead + 1]; +#pragma warning restore CA2014 string key = ConsoleControl.ReadConsole(handle, initialContentLength: 0, inputBuffer, charactersToRead: CharactersToRead, endOnTab: false, out _); #endif From 963117d8660d4122f0fb8fe1221bc9e7dcee18c4 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 11:15:39 -0700 Subject: [PATCH 09/14] Revert PowerShell.Common.props changes --- PowerShell.Common.props | 3 --- 1 file changed, 3 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index efeb970d059..104f2f971d1 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -110,9 +110,6 @@ ../signing/visualstudiopublic.snk true true - - - true From 279c284e1d9a994fd4fd6c18d676cd63e212fb9a Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 11:16:49 -0700 Subject: [PATCH 10/14] Update wix file --- assets/files.wxs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 5d7b42ca97e..a5d09c2604b 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3105,12 +3105,12 @@ - - - + + + @@ -4112,8 +4112,8 @@ - + From d0dcb72cc62e043376d20678842c43edd0825fe0 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 11:41:26 -0700 Subject: [PATCH 11/14] Use .NET recommended way to check UTF-7 encoding --- .../namespaces/FileSystemProvider.cs | 4 +--- src/System.Management.Automation/utils/EncodingUtils.cs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 689a98b0239..c971c8e0b5f 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -7617,9 +7617,7 @@ public Encoding Encoding set { -#pragma warning disable MSLIB0001 - if (value == System.Text.Encoding.UTF7) -#pragma warning restore MSLIB0001 + if (value != null && value.CodePage == 65000) { _provider.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); } diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index cead7ec2442..12f8521d1d0 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -98,9 +98,7 @@ internal static Encoding Convert(Cmdlet cmdlet, string encoding) /// The encoding to check for obsolescence. internal static void WarnIfObsolete(Cmdlet cmdlet, Encoding encoding) { -#pragma warning disable MSLIB0001 - if (encoding == System.Text.Encoding.UTF7) -#pragma warning restore MSLIB0001 + if (encoding != null && encoding.CodePage == 65000) { cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); } From b74c4271873002219cbfda0318dda509c60c6461 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Aug 2020 12:04:32 -0700 Subject: [PATCH 12/14] Add comment about UTF-7 codepage checks --- .../namespaces/FileSystemProvider.cs | 2 ++ src/System.Management.Automation/utils/EncodingUtils.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index c971c8e0b5f..492305bbb76 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -7617,6 +7617,8 @@ public Encoding Encoding set { + // Check for UTF-7 by checking for code page 65000 + // See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete if (value != null && value.CodePage == 65000) { _provider.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index 12f8521d1d0..2ebb6de03d9 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -98,6 +98,8 @@ internal static Encoding Convert(Cmdlet cmdlet, string encoding) /// The encoding to check for obsolescence. internal static void WarnIfObsolete(Cmdlet cmdlet, Encoding encoding) { + // Check for UTF-7 by checking for code page 65000 + // See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete if (encoding != null && encoding.CodePage == 65000) { cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete); From 3da5c1f398501bde23ed34ef7d4f8a3fe14e784d Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL)" Date: Thu, 27 Aug 2020 18:54:30 -0700 Subject: [PATCH 13/14] Fix build to produce exe and not winexe --- src/powershell-win-core/powershell-win-core.csproj | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index 5b91f0ab8b3..16f625827d4 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -11,17 +11,12 @@ win7-x86;win7-x64 Microsoft.PowerShell ..\..\assets\pwsh.manifest - - - - - - true - true Windows 7.0 + + From 228356bd0fbc44fea8f6e382a6721d2036b7354d Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Fri, 28 Aug 2020 09:41:26 -0700 Subject: [PATCH 14/14] Update src/System.Management.Automation/utils/EncodingUtils.cs Co-authored-by: Dongbo Wang --- src/System.Management.Automation/utils/EncodingUtils.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index 2ebb6de03d9..366d749441e 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -8,7 +8,6 @@ using System.Management.Automation.Internal; - namespace System.Management.Automation { internal static class EncodingConversion