major update to override Write-Output func
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user