Qlik-Cli-Windows
Qlik-Cli-Windows copied to clipboard
Updating custom properties
Hi,
I need to remove assigned custom properties(remove assigned "abc" custom property from user) and roles from a user. Please let me know what changes need to be done in the below script. Update-QlikUser -id gdsfgjghhfkjdahbkj -roles ContentAdmin -customProperties "Group=abc"
Thanks and regards Vajid
When updating resources and specifying custom properties the list of properties you provide will overwrite all existing properties on the resource, you can also specify a null value to remove all properties. The following example will remove all custom properties from a user.
Update-QlikUser -id gdsfgjghhfkjdahbkj -customProperties $null
@ahaydon please show example how to append existing custom properties.
I just released a new beta version that adds support for appending properties using the following syntax.
Update-QlikUser -id 1234 -customProperties {$_},'Group=MyGroup'
The {$_}
is a script block that resolves the current properties on the resource being updated, just make sure to include this and you can add other properties as normal.
To install the beta release (v1.22.0-beta3) you can download it from the Releases section or if you have PowerShell Core you can use the following command.
Install-Module -Name Qlik-Cli -RequiredVersion 1.22.0-beta3 -AllowPrerelease
I haven't had chance to test this yet so use at your own risk!