From ee9faba820b30be793526991514721267e21ff3f Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 26 Oct 2019 13:53:40 +0100 Subject: [PATCH 1/5] Disable update notification check for daily builds --- .../host/msh/UpdatesNotification.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs index de68e374bf5..18547206f57 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs @@ -112,6 +112,12 @@ internal static async Task CheckForUpdates() return; } + // Daily builds do not support update notifications + if (PSVersionInfo.PreReleaseLabel?.StartsWith("daily")) + { + return; + } + // Create the update cache directory if it doesn't exists if (!Directory.Exists(s_cacheDirectory)) { From 9d1759902681048b933c69eaf1e250ff41d2805f Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 26 Oct 2019 15:01:59 +0100 Subject: [PATCH 2/5] Fix build --- .../host/msh/UpdatesNotification.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs index 18547206f57..67414b593e3 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs @@ -113,7 +113,8 @@ internal static async Task CheckForUpdates() } // Daily builds do not support update notifications - if (PSVersionInfo.PreReleaseLabel?.StartsWith("daily")) + if (PSVersionInfo.PSCurrentVersion.PreReleaseLabel != null + && PSVersionInfo.PSCurrentVersion.PreReleaseLabel.StartsWith("daily")) { return; } From 68198f142e3c79731520489e684848bd702fbb69 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Sun, 27 Oct 2019 21:55:23 +0000 Subject: [PATCH 3/5] Update src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs Co-Authored-By: Ilya --- .../host/msh/UpdatesNotification.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs index 67414b593e3..9df1f5dae45 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs @@ -114,7 +114,7 @@ internal static async Task CheckForUpdates() // Daily builds do not support update notifications if (PSVersionInfo.PSCurrentVersion.PreReleaseLabel != null - && PSVersionInfo.PSCurrentVersion.PreReleaseLabel.StartsWith("daily")) + && PSVersionInfo.PSCurrentVersion.PreReleaseLabel.StartsWith("daily", StringComparison.OrdinalIgnoreCase)) { return; } From 1ff082baf969827c02a45579fef31ae61bd6a1de Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Wed, 30 Oct 2019 22:02:40 +0000 Subject: [PATCH 4/5] Move check for daily build before network check and use local variable --- .../host/msh/UpdatesNotification.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs index 9df1f5dae45..b7e1464fb80 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs @@ -106,15 +106,15 @@ internal static async Task CheckForUpdates() return; } - // If the host is not connect to a network, skip the rest of the check. - if (!NetworkInterface.GetIsNetworkAvailable()) + // Daily builds do not support update notifications + string preReleaseLabel = PSVersionInfo.PSCurrentVersion.PreReleaseLabel; + if (preReleaseLabel != null && preReleaseLabel.StartsWith("daily")) { return; } - // Daily builds do not support update notifications - if (PSVersionInfo.PSCurrentVersion.PreReleaseLabel != null - && PSVersionInfo.PSCurrentVersion.PreReleaseLabel.StartsWith("daily", StringComparison.OrdinalIgnoreCase)) + // If the host is not connect to a network, skip the rest of the check. + if (!NetworkInterface.GetIsNetworkAvailable()) { return; } From 9f587428fbfaabe87661606a703e741e56c71f49 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Wed, 30 Oct 2019 22:05:10 +0000 Subject: [PATCH 5/5] Bring back StringComparison.OrdinalIgnoreCase (got lost in local merge conflict) --- .../host/msh/UpdatesNotification.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs index b7e1464fb80..7debd1ef1cb 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs @@ -108,7 +108,7 @@ internal static async Task CheckForUpdates() // Daily builds do not support update notifications string preReleaseLabel = PSVersionInfo.PSCurrentVersion.PreReleaseLabel; - if (preReleaseLabel != null && preReleaseLabel.StartsWith("daily")) + if (preReleaseLabel != null && preReleaseLabel.StartsWith("daily", StringComparison.OrdinalIgnoreCase)) { return; }