Product: PowerShell Universal
Version: 3.7.14
Running “Set-PSUCache -Key ‘MyKeyName’ -Value $null” presents the error “Cannot bind argument to parameter ‘Value’ because it is null.” In some cases, I do want to set keys to null, and if we consider the PSU cache to be a kind of storage point to hold variables or other data that needs to cross between runspaces then $null is a legitimate datatype.
I’d love to see Set-PSUCache updated to have the Value parameter updated with [AllowEmptyCollection()], [AllowEmptyString()], and/or [AllowNull()]. Or even a -Null switch to allow clearing a cache variable that was previous set with Set-PSUCache.