From b3bac107ab535da0f132908b0e8741511e8db745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20MICHEL?= Date: Thu, 25 Apr 2024 21:03:28 +0200 Subject: [PATCH 1/2] added version checker --- EasyPIM/internal/scripts/variables.ps1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/EasyPIM/internal/scripts/variables.ps1 b/EasyPIM/internal/scripts/variables.ps1 index 0ca169a..7db2b22 100644 --- a/EasyPIM/internal/scripts/variables.ps1 +++ b/EasyPIM/internal/scripts/variables.ps1 @@ -1,7 +1,7 @@ #*************************************** #* CONFIGURATION #*************************************** - +write-verbose "variables.ps1 called" # LOG TO FILE ( if enable by default it will create a LOGS subfolder in the script folder, and create a logfile with the name of the script ) $script:logToFile = $false # Where logs are written to @@ -26,3 +26,19 @@ $script:HostFQDN = $env:computername + "." + $env:USERDNSDOMAIN # ERROR HANDLING $ErrorActionPreference = "STOP" # make all errors terminating ones so they can be catched + +#checking new version of easyPIM +try { + $currentVersion = ((Get-Module -Name EasyPIM).Version | Select-Object -Last 1).ToString() + Write-Verbose $currentVersion + $latestVersion = (Find-Module -Name EasyPIM).Version + write-verbose $latestVersion + + if ($currentVersion -lt $latestVersion) { + Write-Host "🔥 FYI: A newer version of EasyPIM is available! Run the commands below to update to the latest version." + Write-Host "💥 Installed version: $currentVersion → Latest version: $latestVersion" -ForegroundColor DarkGray + Write-Host "✨ Update-Module EasyPIM" -NoNewline -ForegroundColor Green + Write-Host " → Install the latest version of EasyPIM." -ForegroundColor Yellow + return $true + } +} catch { Write-Verbose -Message $_} \ No newline at end of file From 05e4f51ff87cf10fdb5922c5a79842be63506d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20MICHEL?= Date: Thu, 25 Apr 2024 21:03:55 +0200 Subject: [PATCH 2/2] V1.5.8 --- EasyPIM/EasyPIM.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EasyPIM/EasyPIM.psd1 b/EasyPIM/EasyPIM.psd1 index c6c1f9d..f39ec16 100644 --- a/EasyPIM/EasyPIM.psd1 +++ b/EasyPIM/EasyPIM.psd1 @@ -4,7 +4,7 @@ RootModule = 'EasyPIM.psm1' # Version number of this module. -ModuleVersion = '1.5.7' +ModuleVersion = '1.5.8' # Supported PSEditions # CompatiblePSEditions = @()