updated to NOT uninstall Teams
This commit is contained in:
+7
-21
@@ -1,24 +1,10 @@
|
|||||||
## Stop all instances of Teams
|
## Stop all instances of Teams
|
||||||
End-Process -Name "Teams" -Match -Force
|
End-Process -Name "Teams" -Match -Force
|
||||||
|
|
||||||
If ( $Reinstall ) {
|
## Remove all cached content
|
||||||
|
$CacheDir = "${Env:LOCALAPPDATA}\Microsoft\Teams"
|
||||||
## Uninstall Teams for current user
|
If ( Test-Path $CacheDir ) {
|
||||||
# $Uninstaller = "${Env:LOCALAPPDATA}\Microsoft\Teams\Update.exe"
|
LogMsg "Removing all cached data"
|
||||||
# If ( Test-Path $Uninstaller ) {
|
Try { Remove-Item $CacheDir -Recurse -Force }
|
||||||
# LogMsg "Uninstalling Teams for ${Env:USERNAME}"
|
Catch { LogErr $_.Exception.Message }
|
||||||
# Try { Start-Process $Uninstaller -ArgumentList "--uninstall" -Wait }
|
} Else { LogMsg "Could not clear cached data for Microsoft Teams because the directory could not be found: ${CacheDir}" }
|
||||||
# Catch { LogErr $_.Exception.Message }
|
|
||||||
# } Else { LogMsg "Teams could not be uninstalled for ${Env:USERNAME}" }
|
|
||||||
|
|
||||||
## Remove all cached content
|
|
||||||
$CacheDir = "${Env:LOCALAPPDATA}\Microsoft\Teams"
|
|
||||||
If ( Test-Path $CacheDir ) {
|
|
||||||
LogMsg "Removing all cached data"
|
|
||||||
Try { Remove-Item $CacheDir -Recurse -Force }
|
|
||||||
Catch { LogErr $_.Exception.Message }
|
|
||||||
} Else { LogMsg "Could not clear cached data because the directory could not be found" }
|
|
||||||
|
|
||||||
## ToDo: Reinstall Teams
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user