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 57f5cda3..4a2ca3f2 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 @@ -9029,12 +9029,12 @@ function UninstallPCHealthCheck { $Folder = (New-Object -ComObject Shell.Application).NameSpace("$env:SystemRoot\Installer") $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" foreach ($MSI in @(Get-ChildItem -Path "$env:SystemRoot\Installer" -Filter *.msi -File -Force)) { - $name = $Files.Keys | Where-Object -FilterScript { $_ -eq $MSI.Name } - $File = $Files[$name] + $Name = $Files.Keys | Where-Object -FilterScript {$_ -eq $MSI.Name} + $File = $Files[$Name] # https://learn.microsoft.com/en-us/previous-versions/tn-archive/ee176615(v=technet.10) # "22" is the "Subject" file property