Browse Source

Update Sophia.psm1

pull/429/head
Dmitry Nefedov 2 years ago
committed by GitHub
parent
commit
d341c2d567
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

4
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -9021,11 +9021,11 @@ function UninstallPCHealthCheck
{ {
$Folder = (New-Object -ComObject Shell.Application).NameSpace("$env:SystemRoot\Installer") $Folder = (New-Object -ComObject Shell.Application).NameSpace("$env:SystemRoot\Installer")
$Files = [hashtable]::new() $Files = [hashtable]::new()
$Folder.Items() | ForEach-Object -Process { $Files.Add($_.Name, $_) } | Out-Null $Folder.Items() | ForEach-Object -Process {$Files.Add($_.Name, $_)} | Out-Null
# 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.Name } $name = $Files.Keys | Where-Object -FilterScript {$_ -eq $MSI.Name}
$File = $Files[$name] $File = $Files[$name]
# https://learn.microsoft.com/en-us/previous-versions/tn-archive/ee176615(v=technet.10) # https://learn.microsoft.com/en-us/previous-versions/tn-archive/ee176615(v=technet.10)

Loading…
Cancel
Save