Public/Get-DokuServerRpcVersionSupported.ps1
function Get-DokuServerRpcVersionSupported { <# .SYNOPSIS Returns the servers minimum supported RPC API version. .DESCRIPTION Returns the servers minimum supported RPC API version. .PARAMETER DokuSession The DokuSession (generated by New-DokuSession) from which to get the supported RPC version. .EXAMPLE PS C:\> $RPCVersionsSupported = Get-DokuServerRpcVersionSupported -DokuSession $DSession .OUTPUTS System.Management.Automation.PSObject .NOTES AndyDLP - 2018-05-26 #> [CmdletBinding(PositionalBinding = $true)] [OutputType([psobject])] param ( [Parameter(Mandatory = $true, Position = 1, ValueFromPipeline = $true, HelpMessage = 'The DokuSession from which to get the supported version.')] [ValidateNotNullOrEmpty()] [DokuWiki.Session.Detail]$DokuSession ) begin { } # begin process { $APIResponse = Invoke-DokuApiCall -DokuSession $DokuSession -MethodName 'wiki.getRPCVersionSupported' -MethodParameters @() if ($APIResponse.CompletedSuccessfully -eq $true) { [int]$RPCVersionsSupported = ($APIResponse.XMLPayloadResponse | Select-Xml -XPath "//value/int").node.InnerText $VersionObject = New-Object PSObject -Property @{ Server = $DokuSession.Server MinimumRpcVersionSupported = $RPCVersionsSupported } $VersionObject } elseif ($null -eq $APIResponse.ExceptionMessage) { Write-Error "Fault code: $($APIResponse.FaultCode) - Fault string: $($APIResponse.FaultString)" } else { Write-Error "Exception: $($APIResponse.ExceptionMessage)" } } # process end { } # end } |