Skip to content

Commit

Permalink
Added docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom Neale committed Jan 2, 2025
1 parent 8e4e296 commit 8230ca2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions PowerShell/ScubaGear/CheckVersion.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
function Invoke-CheckScubaGearVersion {
<#
.SYNOPSIS
Complain if a newer version of ScubaGear is available on PSGallery.
.DESCRIPTION
Checks PSGallery latest version and compares it to the latest version installed
from PSGallery.
#>

# Retrieve the installed version of ScubaGear from the system
$InstalledModule = Get-Module -Name ScubaGear -ListAvailable -ErrorAction 'Stop'
Expand Down Expand Up @@ -29,6 +37,13 @@ function Invoke-CheckScubaGearVersion {


function Invoke-CheckScubaGearVersionGithub {
<#
.SYNOPSIS
Complain if a newer version of ScubaGear is available from the Github release page.
.DESCRIPTION
Checks latest version available on the github release page and compares it to the current running verison.
#>
$ScubaManifest = Import-PowerShellDataFile (Join-Path -Path $PSScriptRoot -ChildPath 'ScubaGear.psd1' -Resolve -ErrorAction 'Stop' ) -ErrorAction 'Stop'
$CurrentVersion = [System.Version]$ScubaManifest.ModuleVersion
$LatestVersion = [System.Version]$(Invoke-RestMethod -Uri "https://api.github.com/repos/cisagov/ScubaGear/releases/latest" -ErrorAction 'Stop').tag_name.TrimStart("v")
Expand Down

0 comments on commit 8230ca2

Please sign in to comment.