Skip to content

Commit

Permalink
Teams uninstall fix and json template
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Mohrmann authored and Dennis Mohrmann committed Mar 26, 2021
1 parent f4d7295 commit 0ffb86c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Install MS Teams-Preview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ else {
# Check, if a new version is available
$Version = Get-Content -Path "$PSScriptRoot\$Product\Version.txt"
$Teams = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object {$_.DisplayName -like "*Teams Machine*"}).DisplayVersion
IF ($Teams) {$Teams.Insert(5,'0')}
IF ($Teams) {$Teams = $Teams.Insert(5,'0')}
IF ($Teams -ne $Version) {

#Uninstalling MS Teams
# Uninstalling MS Teams
IF (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where DisplayName -like "*Teams Machine*") {
Write-Host -ForegroundColor Yellow "Uninstalling $Product"
DS_WriteLog "I" "Uninstalling $Product" $LogFile
Expand All @@ -111,7 +111,7 @@ Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

#MS Teams Installation
# MS Teams Installation
Write-Host -ForegroundColor Yellow "Installing $Product"
DS_WriteLog "I" "Installing $Product" $LogFile
try {
Expand All @@ -121,8 +121,8 @@ DS_WriteLog "E" "Error installing $Product (error: $($Error[0]))" $LogFile
}
DS_WriteLog "-" "" $LogFile

# Configure Teams Settings with json template
copy-item -Path "$PSScriptRoot\$Product\desktop-config.json" -Destination "C:\USers\Default\AppData\Roaming\Microsoft\Teams"
# Configure Teams Settings with json template, template must exist
# copy-item -Path "$PSScriptRoot\$Product\desktop-config.json" -Destination "C:\USers\Default\AppData\Roaming\Microsoft\Teams"

# Prevents MS Teams from starting at logon
Start-Sleep 5
Expand Down
6 changes: 3 additions & 3 deletions Install MS Teams.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else {
# Check, if a new version is available
$Version = Get-Content -Path "$PSScriptRoot\$Product\Version.txt"
$Teams = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object {$_.DisplayName -like "*Teams Machine*"}).DisplayVersion
IF ($Teams) {$Teams.Insert(5,'0')}
IF ($Teams) {$Teams = $Teams.Insert(5,'0')}
IF ($Teams -ne $Version) {

#Uninstalling MS Teams
Expand Down Expand Up @@ -121,8 +121,8 @@ DS_WriteLog "E" "Error installing $Product (error: $($Error[0]))" $LogFile
}
DS_WriteLog "-" "" $LogFile

# Configure Teams Settings with json template
copy-item -Path "$PSScriptRoot\$Product\desktop-config.json" -Destination "C:\USers\Default\AppData\Roaming\Microsoft\Teams"
# Configure Teams Settings with json template, template must exist!
# copy-item -Path "$PSScriptRoot\$Product\desktop-config.json" -Destination "C:\USers\Default\AppData\Roaming\Microsoft\Teams"

# Prevents MS Teams from starting at logon
Start-Sleep 5
Expand Down
8 changes: 8 additions & 0 deletions MS Teams - Preview Release/desktop-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"appPreferenceSettings": {
"runningOnClose": true,
"disableGpu": true,
"callingMWEnabledPreferenceKey": false
},
"theme": "default"
}
8 changes: 8 additions & 0 deletions MS Teams/desktop-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"appPreferenceSettings": {
"runningOnClose": true,
"disableGpu": true,
"callingMWEnabledPreferenceKey": false
},
"theme": "default"
}

0 comments on commit 0ffb86c

Please sign in to comment.