Browse Source

Improved UninstallPCHealthCheck function

pull/636/head
Dmitry Nefedov 2 weeks ago
parent
commit
8948d2929c
  1. 2
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  2. 2
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

2
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" # 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)) 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 # Checking whether necessary files exist in folder unless we get a bunch of errors for $File variable
if ($Name) if ($Name)
{ {

2
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" # 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)) 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 # Checking whether necessary files exist in folder unless we get a bunch of errors for $File variable
if ($Name) if ($Name)
{ {

Loading…
Cancel
Save