diff --git a/Cleanup-SystemTempFiles.ps1 b/Cleanup-SystemTempFiles.ps1 index e720ab4..99d77b9 100644 --- a/Cleanup-SystemTempFiles.ps1 +++ b/Cleanup-SystemTempFiles.ps1 @@ -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 } + } } } diff --git a/Fix-MicrosoftTeams.ps1 b/Fix-MicrosoftTeams.ps1 new file mode 100644 index 0000000..8543dd3 --- /dev/null +++ b/Fix-MicrosoftTeams.ps1 @@ -0,0 +1 @@ +End-Process -Name "Teams" -Match -Force \ No newline at end of file diff --git a/Install-Wireguard.ps1 b/Install-Wireguard.ps1 index 1183616..2762a05 100644 --- a/Install-Wireguard.ps1 +++ b/Install-Wireguard.ps1 @@ -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" } \ No newline at end of file