Skip to content

Commit

Permalink
Merge pull request #42 from kayasax/MggraphErrorHandling
Browse files Browse the repository at this point in the history
added a new version checker
  • Loading branch information
kayasax authored Apr 29, 2024
2 parents 56c6219 + 05e4f51 commit b2786e4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EasyPIM/EasyPIM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'EasyPIM.psm1'

# Version number of this module.
ModuleVersion = '1.5.7'
ModuleVersion = '1.5.8'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
18 changes: 17 additions & 1 deletion EasyPIM/internal/scripts/variables.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 $_}

0 comments on commit b2786e4

Please sign in to comment.