Last active
March 4, 2017 23:05
-
-
Save lipkau/4e26ab6be76ffb6b729d231129564bc9 to your computer and use it in GitHub Desktop.
Fetch version of the confluence Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ConfluenceVersion { | |
[CmdletBinding()] | |
param ( | |
# Server | |
[Parameter(Mandatory = $true)] | |
[string] $ServerUrl | |
) | |
begin { | |
$response = Invoke-RESTMethod -Uri $ServerUrl | |
$meta = ($response | Select-string -Pattern 'meta name="ajs-version-number" content="(.+)"' -AllMatches).Matches.value | |
$metaVersion = $meta -match 'content="(?<version>[\d\.]+)"' | |
[version]$matches["version"] | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment