fixed log message
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
LogMsg "Cleanup-SystemPath.ps1"
|
||||
|
||||
## Get contents of SYSTEM PATH environment variable
|
||||
## Get contents of SYSTEM PATH environment variable
|
||||
$REG_ENVVAR = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
|
||||
$CURRENT_PATH = (Get-ItemProperty -Path $REG_ENVVAR -Name Path).Path
|
||||
$NEW_PATH = $null
|
||||
@@ -26,7 +24,7 @@ LogMsg "Removed Paths:`n`r${REMOVE_PATH}"
|
||||
Try { Set-ItemProperty -Path $REG_ENVVAR -Name Path -Value $NEW_PATH }
|
||||
Catch
|
||||
{
|
||||
$_.Exception.Message | Log -Error -Name $LogName
|
||||
LogErr $_.Exception.Message
|
||||
LogErr "Failed to cleanup system path, using original values"
|
||||
Try { Set-ItemProperty -Path $REG_ENVVAR -Name Path -Value $CURRENT_PATH }
|
||||
Catch
|
||||
|
||||
Reference in New Issue
Block a user