Ccmexec/MEMCM-OSD-Scripts

Windows 11 RemoveApps.ps1 script is checking for the wrong file

Opened this issue · 0 comments

I believe there is an error on line 8 of your RemoveApps.ps1 script on the Windows 11 removeapp zip folder. It's checking for the apps$($Buildnr).txt file and opening the Capabilities$($Buildnr).txt that may not exist and throw an exception

Currently its:

# If a capabilities file exist with a matching buildnumber it will remove the capabilities in it.
$FileExists = Test-Path "$($PSScriptRoot)\apps$($Buildnr).txt"
If ($FileExists) {
    $Capabilities = Get-Content "$($PSScriptRoot)\Capabilities$($Buildnr).txt"

should be

# If a capabilities file exist with a matching buildnumber it will remove the capabilities in it.
$FileExists = Test-Path "$($PSScriptRoot)\Capabilities$($Buildnr).txt"
If ($FileExists) {
    $Capabilities = Get-Content "$($PSScriptRoot)\Capabilities$($Buildnr).txt"