Compare commits

..
2 Commits
Author SHA1 Message Date
dyoder a473e079f4 added log entry 2022-03-09 12:59:33 -05:00
dyoder dc58b30ef2 fixed log message 2022-03-09 12:59:22 -05:00
2 changed files with 3 additions and 4 deletions
+2 -4
View File
@@ -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
+1
View File
@@ -4,4 +4,5 @@
End-Process -Name "Teams" -Match -Force
# Clear all cached content
LogMsg "Deleting all cached data for Microsoft Teams"
Get-ChildItem -Path "${Env:AppData}\Microsoft\Teams" -Recurse | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue