Public/Get-IAMCoreConnectorDataStatistics.ps1
|
function Get-IAMCoreConnectorDataStatistics { [CmdletBinding()] param ( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidatePattern("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")] # Is a guid connector object id [String] $Id ) Begin { if (-not $Script:APIRoot -or -not $Script:AccessTokenProfile) { throw "Not connected to IAM Core. Please run Connect-IAMCore first." } } Process { $Result = Invoke-RestMethod -Uri "$Script:APIRoot/sync/connectors/$($Id)/data/statistics" -Headers (Get-IAMCoreHeader) if ($Result.IsSuccess) { return $Result.Data } else { throw "Failed to get IAM Core connector data statistics: $($Result.ErrorMessage)" } } } |