This repository was archived by the owner on Aug 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ param (
2424 [switch ]$listEntityCategories ,
2525 [switch ]$listTypes ,
2626 [switch ]$listCustomCategories ,
27+ [switch ]$listInstructions ,
2728 # dry run
2829 [switch ]$dryRun ,
2930 [switch ]$detailed
@@ -105,6 +106,11 @@ if (Test-Path $cleanupListFile)
105106 }
106107 exit 0
107108 }
109+ elseif ($listInstructions )
110+ {
111+ $preventionInstructions = Show-PreventionInstructions ($cleanupListFile )
112+ Write-PreventionInstructions $preventionInstructions
113+ }
108114 elseif ($dryRun )
109115 {
110116 $version = Get-Content - Path (Join-Path $PSScriptRoot ./ version)
Original file line number Diff line number Diff line change 1+ . (Join-Path $PSScriptRoot ./ prevention- instructions.ps1)
2+
13function Show-Applications {
24 param (
35 [Parameter (Mandatory = $true )]
@@ -95,5 +97,27 @@ function Show-CustomCategories {
9597 }
9698 }
9799
100+ return $result
101+ }
102+
103+ function Show-PreventionInstructions {
104+ param (
105+ [Parameter (Mandatory = $true )]
106+ [string ]$cleanupListFile
107+ )
108+
109+ $result = New-Object System.Collections.Generic.List[object ]
110+
111+ $json = Get-Content - Raw $cleanupListFile | ConvertFrom-Json
112+ $properties = $json.PsObject.Properties
113+ $properties | ForEach-Object {
114+ $instructions = $_.Value.instructions
115+ if ((-not $result.Contains ($instructions )) -and (-not [String ]::IsNullOrEmpty($instructions )))
116+ {
117+ $item = Add-PreventionInstructions - name $_.Name - location $_.Value.delete.location - instructions $_.Value.instructions
118+ $result.Add ($item )
119+ }
120+ }
121+
98122 return $result
99123}
You can’t perform that action at this time.
0 commit comments