Skip to content

Commit

Permalink
Fixes for #10 so version string can be found for any version.
Browse files Browse the repository at this point in the history
  • Loading branch information
darksidemilk committed Aug 18, 2024
1 parent 577eec1 commit f6087d0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
9 changes: 3 additions & 6 deletions FogApi/FogApi.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'FogApi.psm1'

# Version number of this module.
ModuleVersion = '2408.6.9'
ModuleVersion = '2408.6.11'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -183,12 +183,9 @@ PrivateData = @{

# ReleaseNotes of this module
ReleaseNotes = '
# 2408.6.9
# 2408.6.11
Created Get-FogVersion and implmented check for 1.6 version
so correct dynamic parameters are used for 1.5.x vs 1.6
Also added a separate build test script for running a build test
on each push.'
Fix get-fogversion if before version 1.6 or if error on info page'

# Prerelease string of this module
# Prerelease = ''
Expand Down
11 changes: 7 additions & 4 deletions FogApi/Public/Get-FogVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ function Get-FogVersion {
Will return the full version string
.NOTES
General notes
#>
[CmdletBinding()]
param (
Expand All @@ -21,10 +19,15 @@ function Get-FogVersion {


process {
$versionStr = (Invoke-FogApi -uriPath "system/info" -Method Get).version;
$info = (Invoke-FogApi -uriPath "system/info" -Method Get -ea 0)
if ($null -ne $info) {
$versionStr = $info.version;
}
if ([string]::IsNullOrEmpty($versionStr)) {
return "1.5.10";
"Error finding version on system/info pass, getting version from getversion.php" | out-host;
$versionStr = (Invoke-FogApi -uriPath "service/getversion.php" -Method Get )
}
return $versionStr
}

}
6 changes: 6 additions & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 6.x

### 2408.6.11

Fix get-fogversion if before version 1.6 or if error on info page

### 2408.6.9

Created Get-FogVersion and implmented check for 1.6 version
Expand Down Expand Up @@ -310,3 +314,5 @@





1 change: 0 additions & 1 deletion docs/commands/Get-FogVersion.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
## NOTES
General notes
## RELATED LINKS
2 changes: 1 addition & 1 deletion docs/en-us/FogApi-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2587,7 +2587,7 @@ $mods</dev:code>
<command:returnValues />
<maml:alertSet>
<maml:alert>
<maml:para>General notes</maml:para>
<maml:para></maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
Expand Down

0 comments on commit f6087d0

Please sign in to comment.