diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index 83986a6c..504a28cc 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -9900,7 +9900,7 @@ function UninstallPCHealthCheck # Find the necessary .msi with the Subject property equal to "Windows PC Health Check" foreach ($MSI in @(Get-ChildItem -Path "$env:SystemRoot\Installer" -Filter *.msi -File -Force)) { - $Name = $Files.Keys | Where-Object -FilterScript {$_ -eq $MSI.BaseName} + $Name = $Files.Keys | Where-Object -FilterScript {($_ -eq $MSI.BaseName) -or ($_ -eq $MSI.Name)} # Checking whether necessary files exist in folder unless we get a bunch of errors for $File variable if ($Name) { diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index dd014162..58097682 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -9934,7 +9934,7 @@ function UninstallPCHealthCheck # Find the necessary .msi with the Subject property equal to "Windows PC Health Check" foreach ($MSI in @(Get-ChildItem -Path "$env:SystemRoot\Installer" -Filter *.msi -File -Force)) { - $Name = $Files.Keys | Where-Object -FilterScript {$_ -eq $MSI.BaseName} + $Name = $Files.Keys | Where-Object -FilterScript {($_ -eq $MSI.BaseName) -or ($_ -eq $MSI.Name)} # Checking whether necessary files exist in folder unless we get a bunch of errors for $File variable if ($Name) {