major update to override Write-Output func

This commit is contained in:
2023-10-05 13:11:38 -04:00
parent 31a06a9206
commit bbb4884818
52 changed files with 377 additions and 378 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
LogMsg "Fix-WindowsScriptingComponents.ps1"
Write-Output "Fix-WindowsScriptingComponents.ps1"
## List of all scripting component DLL files
$DLL_FILES = @("${Env:WINDIR}\system32\vbscript.dll",
@@ -22,7 +22,7 @@ ForEach ($dll in $DLL_FILES)
If ( Test-Path $dll )
{
If ( $dll -Match "syswow64" ) { $REGSVR32 = "${Env:WINDIR}\syswow64\regsvr32" } Else { $REGSVR32 = "regsvr32" }
LogMsg "Unregister: ${dll}"
Write-Output "Unregister: ${dll}"
Try { Start-Process "${REGSVR32}" -ArgumentList "/u /s ${dll}" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -35,7 +35,7 @@ ForEach ($dll in $DLL_FILES)
{
If ( $dll -Match "syswow64" )
{ $REGSVR32 = "${Env:WINDIR}\syswow64\regsvr32" } Else { $REGSVR32 = "regsvr32" }
LogMsg "Register: ${dll}"
Write-Output "Register: ${dll}"
Try { Start-Process "${REGSVR32}" -ArgumentList "/s ${dll}" -Wait }
Catch { LogErr $_.Exception.Message }
}