Public/Get-JiraServerInformation.ps1
function Get-JiraServerInformation { <# .SYNOPSIS This function returns the information about the JIRA Server .DESCRIPTION This functions shows all the information about the JIRA server, such as version, time, etc .EXAMPLE Get-JiraServerInformation This example returns information about the JIRA server. .INPUTS .OUTPUTS [JiraPS.ServerInfo] .NOTES This function requires either the -Credential parameter to be passed or a persistent JIRA session. See New-JiraSession for more details. If neither are supplied, this function will run with anonymous access to JIRA. #> [CmdletBinding()] param( # Credentials to use to connect to JIRA. # If not specified, this function will use anonymous access. [PSCredential] $Credential ) begin { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" $server = Get-JiraConfigServer -ErrorAction Stop $resourceURi = "$server/rest/api/latest/serverInfo" } process { Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] ParameterSetName: $($PsCmdlet.ParameterSetName)" Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" $parameter = @{ URI = $resourceURi Method = "GET" Credential = $Credential } Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" $result = Invoke-JiraMethod @parameter Write-Output (ConvertTo-JiraServerInfo -InputObject $result) } end { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" } } New-Alias -Name "Get-JiraServerInfo" -Value "Get-JiraServerInformation" -ErrorAction SilentlyContinue |