Compare commits
2
Commits
cabc7bcbbf
...
a473e079f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a473e079f4 | ||
|
|
dc58b30ef2 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user