Get-QlikUser.ps1
function Get-QlikUser { <# .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-QlikUser 'abc' Description of the example. #> <# Enable -Confirm and -WhatIf. #> [CmdletBinding(SupportsShouldProcess = $true)] param( [parameter(Position=0,ValueFromPipelinebyPropertyName=$true)] [string]$id, [string]$filter, [switch]$full, [switch]$raw ) begin { } process { $path = "/qrs/user" If( $id ) { $path += "/$id" } If( $full ) { $path += "/full" } If( $raw ) { $rawOutput = $true } $result = Invoke-QlikGet $path $filter if( $raw -Or $full ) { return $result } else { $properties = @('name','userDirectory','userId') #if( $full ) { $properties += @('roles','inactive','blacklisted','removedExternally') } return $result | select -Property $properties } } end { } } if ($loadingModule) { Export-ModuleMember -Function 'Get-QlikUser' } |