File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 2025-09-01
4+
5+ ### Fixed
6+
7+ - Improper handling of null data in 'Set-CachedData'.
8+
39## 2025-08-30
410
511### Added
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ function Set-CachedData {
5353 [String ] $Name ,
5454
5555 [Parameter (Mandatory = $true )]
56+ [AllowEmptyCollection ()]
5657 [Object []] $Data
5758 )
5859
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ function Get-CurrentUserDenySid {
2020 param ()
2121
2222 if (-not (Test-CachedData - Name " CurrentUserDenySids" )) {
23- $CurrentUserDenySids = [string []](Get-TokenInformationGroup - InformationClass Groups | Where-Object { $_.Attributes.Equals (" UseForDenyOnly" ) } | Select-Object - ExpandProperty SID)
23+ $CurrentUserDenySids = @ ()
24+ Get-TokenInformationGroup - InformationClass Groups | Where-Object { $_.Attributes.Equals (" UseForDenyOnly" ) } | Select-Object - ExpandProperty SID | ForEach-Object {
25+ $CurrentUserDenySids += $_
26+ }
2427 Set-CachedData - Name " CurrentUserDenySids" - Data $CurrentUserDenySids
2528 }
2629
@@ -33,7 +36,8 @@ function Get-InstalledApplication {
3336 param ()
3437
3538 if (-not (Test-CachedData - Name " InstalledApplicationList" )) {
36- $InstalledApplicationList = Get-InstalledApplicationHelper
39+ $InstalledApplicationList = @ ()
40+ Get-InstalledApplicationHelper | ForEach-Object { $InstalledApplicationList += $_ }
3741 Set-CachedData - Name " InstalledApplicationList" - Data $InstalledApplicationList
3842 }
3943
You can’t perform that action at this time.
0 commit comments