fixed Cleanup-SystemTempFiles.ps1 to check for Genetec dump files before cleaning them

added Fix-MicrosoftTeams.ps1
updated Install-Wireguard.ps1 to use automated installer
This commit is contained in:
2020-12-03 17:13:13 -05:00
parent 76148f6b87
commit 8b17d15196
3 changed files with 16 additions and 15 deletions
+8 -6
View File
@@ -52,12 +52,14 @@ If ( IsAdmin )
}
## Remove Genetec application crash dumps
$GenetecCrashDumps = Get-ChildItem -Path "${Env:ProgramData}\Genetec\Dumps" | Where { $_.Name -match "^.*_Crash(\.zip)?$" }
If ( $GenetecCrashDumps )
{
LogMsg "Deleting Genetec application crash dumps"
Try { ForEach ( $dump in $GenetecCrashDumps ) { Remove-Item $dump.FullName -Force -Recurse -ErrorAction SilentlyContinue } }
Catch { LogErr $_.Exception.Message }
If ( Test-Path "${Env:ProgramData}\Genetec\Dumps" ) {
$GenetecCrashDumps = Get-ChildItem -Path "${Env:ProgramData}\Genetec\Dumps" | Where { $_.Name -match "^.*_Crash(\.zip)?$" }
If ( $GenetecCrashDumps )
{
LogMsg "Deleting Genetec application crash dumps"
Try { ForEach ( $dump in $GenetecCrashDumps ) { Remove-Item $dump.FullName -Force -Recurse -ErrorAction SilentlyContinue } }
Catch { LogErr $_.Exception.Message }
}
}
}
+1
View File
@@ -0,0 +1 @@
End-Process -Name "Teams" -Match -Force
+7 -9
View File
@@ -1,16 +1,14 @@
$WireguardVersion = "0.2.3"
## Make sure we have an administrative token
If ( IsAdmin )
{
If ( Is64bit ) { $bitness = "amd64" } Else { $bitness = "x86" }
$URL = "https://download.wireguard.com/windows-client/wireguard-${bitness}-${WireguardVersion}.msi"
$URL = "https://download.wireguard.com/windows-client/wireguard-installer.exe"
## Install package
LogMsg "Installing Wireguard v${WireguardVersion} from ${URL}"
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${URL} /qn /norestart" }
Catch { LogErr $_.Exception.Message }
$Installer = Download-File -URL $URL
If ( Test-Path $Installer ) {
End-Process -Name "wireguard" -Match -Force
Install-Program -Path "${Installer}" -Delete
}
Else { LogMsg "The Wireguard installer was not downloaded properly" }
}
Else { LogMsg "Must be an administrator to install Wireguard" }