Qlik-Cli-Windows icon indicating copy to clipboard operation
Qlik-Cli-Windows copied to clipboard

Updating custom properties

Open abdulvajid4525 opened this issue 2 years ago • 1 comments

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

abdulvajid4525 avatar Jul 29 '22 14:07 abdulvajid4525

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 avatar Jul 29 '22 14:07 ahaydon

@ahaydon please show example how to append existing custom properties.

chevcheli0s avatar Jan 18 '23 09:01 chevcheli0s

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!

ahaydon avatar Jan 18 '23 09:01 ahaydon