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 1
1
# Changelog
2
2
3
+ ## 2025-09-01
4
+
5
+ ### Fixed
6
+
7
+ - Improper handling of null data in 'Set-CachedData'.
8
+
3
9
## 2025-08-30
4
10
5
11
### Added
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ function Set-CachedData {
53
53
[String ] $Name ,
54
54
55
55
[Parameter (Mandatory = $true )]
56
+ [AllowEmptyCollection ()]
56
57
[Object []] $Data
57
58
)
58
59
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ function Get-CurrentUserDenySid {
20
20
param ()
21
21
22
22
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
+ }
24
27
Set-CachedData - Name " CurrentUserDenySids" - Data $CurrentUserDenySids
25
28
}
26
29
@@ -33,7 +36,8 @@ function Get-InstalledApplication {
33
36
param ()
34
37
35
38
if (-not (Test-CachedData - Name " InstalledApplicationList" )) {
36
- $InstalledApplicationList = Get-InstalledApplicationHelper
39
+ $InstalledApplicationList = @ ()
40
+ Get-InstalledApplicationHelper | ForEach-Object { $InstalledApplicationList += $_ }
37
41
Set-CachedData - Name " InstalledApplicationList" - Data $InstalledApplicationList
38
42
}
39
43
You can’t perform that action at this time.
0 commit comments