Skip to content
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions CIPPAPIModule/private/Test-CIPPAPIModuleUpdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,13 @@ function Test-CIPPAPIModuleUpdate {
}
# Ensure Version object exists before accessing ToString()
if ($InstalledModule.Version) {
$LocalVersionString = $InstalledModule.Version.ToString()
$LocalVersion = [version]$InstalledModule.Version.ToString()
Comment thread
kris6673 marked this conversation as resolved.
Outdated
} else {
Write-Warning "Module '$ModuleName' found via Get-InstalledModule or Get-InstalledPSResource, but version information is missing. Cannot check for updates."
return
}

# Ensure the version string is in a valid format
try {
$LocalVersion = [version]$LocalVersionString
Write-Verbose "Local CIPPAPIModule version: $LocalVersion"
} catch {
Write-Warning "Local version string '$LocalVersionString' from manifest is not a valid version format. Error: $($_.Exception.Message). Cannot check for updates."
return
}
Write-Verbose "Local $ModuleName version: $LocalVersion"
Comment thread
homotechsual marked this conversation as resolved.
Outdated

try {
# Find the module in the gallery
Expand Down