Public/EntryStatistics/Stop-R1Operation.ps1

# .ExternalHelp psRadiantOne-help.xml
function Stop-R1Operation {
    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
    [OutputType([void])]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true
        )]
        [ValidateNotNullOrEmpty()]
        [string]$name
    )

    Begin {

        Assert-R1Session -RequireToken

    }#begin

    Process {

        $URI = Resolve-R1ServiceUrl -Service Settings -Path "operations/$($name | Get-EscapedString)/stop"

        if ($PSCmdlet.ShouldProcess($name, 'Stop Entry Statistics Refresh')) {

            $null = Invoke-R1RestMethod -Uri $URI -Method POST

        }

    }#process

    End { }#end

}