I have a requirement to show list of options as checklist to user for selection. If followed In Powershell how to enable/show options like Select All | DeSelect All for Multilist field type , it have static data for checklist then its working fine but when i am having an object whoes value evaluated at runtime then its not working. e.g.
$scriptlist=@{} $scriptitems = get-childitem '/sitecore/system/Modules/PowerShell/Script Library' -recurse | where{$_.templateid -eq '{DD22F1B3-BD87-4DB2-9E7D-F7A496888D43}' } |foreach-object{ $currentscript=$_ $scriptlist.add($currentscript.id.guid,$currentscript.DisplayName) }
Now i want to show this list as input to user, if i use below code:
$dialogParams = @{ Title = "Dialog title" Description = "Description under title" OkButtonName = "Execute" CancelButtonName = "Close" ShowHints = $true Parameters = @( @{ Name = "checkListSelector" Title = "Checklist Selector" Editor = "checklist" Options = $scriptlist Tooltip = "Select one or more options" } ) }
$dialogResult = Read-Variable @dialogParams
Although i tried to change (Options = $scriptlist)
with new variable but that also didn't work.
Please let me know if i am missing anything.