Get-QlikLicenseAudit.ps1

function Get-QlikLicenseAudit {
    <#
    .SYNOPSIS
    This function ...
 
    .DESCRIPTION
    A bit more description
 
    .PARAMETER FromPipeline
    Shows how to process input from the pipeline, remaining parameters or by named parameter.
 
    .EXAMPLE
    Get-QlikLicenseAudit 'abc'
 
    Description of the example.
 
    #>


    <# Enable -Confirm and -WhatIf. #>
    [CmdletBinding(SupportsShouldProcess = $true)]
    param(
        [string]$resourceType,
    [string]$resourceFilter,
    [string]$userFilter,
    [string]$environmentAttributes,
    [int]$userSkip,
    [int]$userTake,
    [int]$resourceSkip,
    [int]$resourceTake,
    [switch]$includeNonGrantingRules,
    [parameter(ValueFromPipelinebyPropertyName=$true)]
    [alias("id")]
    [string]$resourceId,
    [switch]$raw
    )

    begin {
    }

    process {
    $params = @{
      resourceType = $resourceType;
      resourceFilter = $resourceFilter;
      userFilter = $userFilter;
      environmentAttributes = $environmentAttributes;
      userSkip = $userSkip;
      userTake = $userTake;
      resourceSkip = $resourceSkip;
      resourceTake = $resourceTake;
    }
    If( $includeNonGrantingRules ) { $params.includeNonGrantingRules = $true }
    If( $resourceId ) { $params.resourceFilter = "id eq $resourceId" }
    $json = $params | ConvertTo-Json -Compress -Depth 10
    If( $raw ) { $rawOutput = $true }
    return Invoke-QlikPost "/qrs/systemrule/license/audit" $json
  }

    end {
    }
}

if ($loadingModule) {
    Export-ModuleMember -Function 'Get-QlikLicenseAudit'
}