Skip to content

Instantly share code, notes, and snippets.

@lipkau
Last active March 4, 2017 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lipkau/4e26ab6be76ffb6b729d231129564bc9 to your computer and use it in GitHub Desktop.
Save lipkau/4e26ab6be76ffb6b729d231129564bc9 to your computer and use it in GitHub Desktop.
Fetch version of the confluence Server
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