You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Boolean to indicate if the version check has already been performed
@@ -67,19 +69,29 @@ public static void CheckVersion(PSCmdlet cmdlet)
67
69
cmdlet?.WriteVerbose($"Checking for updates, current version is {productVersion}. See https://pnp.github.io/powershell/articles/configuration.html#disable-or-enable-version-checks for more information.");
68
70
69
71
// Check for the latest available version
70
-
varonlineVersion=GetAvailableVersion2(isNightly);
71
-
72
-
if(IsNewer(onlineVersion))
72
+
varonlineVersion=GetAvailableVersion3(isNightly);
73
+
if(onlineVersion!=null)
73
74
{
74
-
if(cmdlet!=null)
75
+
76
+
if(IsNewer(onlineVersion.Version))
75
77
{
76
-
varupdateMessage=$"\nA newer version of PnP PowerShell is available: {onlineVersion}.\n\nUse 'Update-Module -Name PnP.PowerShell{(isNightly?" -AllowPrerelease":"")}' to update.\nUse 'Get-PnPChangeLog {(!isNightly?$"-Release {onlineVersion}":"-Nightly")}' to list changes.\n\nYou can turn this check off by setting the 'PNPPOWERSHELL_UPDATECHECK' environment variable to 'Off'.\n";
varupdateMessage=$"\nA newer version of PnP PowerShell is available: {onlineVersion}.\n\nUse 'Update-Module -Name PnP.PowerShell{(isNightly?" -AllowPrerelease":"")}' to update.\nUse 'Get-PnPChangeLog {(!isNightly?$"-Release {onlineVersion}":"-Nightly")}' to list changes.\n\nYou can turn this check off by setting the 'PNPPOWERSHELL_UPDATECHECK' environment variable to 'Off'.\n";
// Deliberately lowering timeout as the version check is not critical so in case of a slower or blocked internet connection, this should not block the cmdlet for too long
// Deliberately lowering timeout as the version check is not critical so in case of a slower or blocked internet connection, this should not block the cmdlet for too long
// Deliberately lowering timeout as the version check is not critical so in case of a slower or blocked internet connection, this should not block the cmdlet for too long
/// Retrieves the latest available version of PnP PowerShell. If the current version is a nightly build, it will check for the latest nightly build as well. If the current version is a stable build, it will only check for the latest stable build.
187
217
/// </summary>
188
218
/// <returns>The latest available version</returns>
0 commit comments