# Script to install AnyConnect VPN Client # Technolog Networks - 2025-10-13 # iRaven <# .SYNOPSIS Installs Cisco AnyConnect/Secure VPN Client .PARAMETER SBL Boolean to install Start Before Logon module. #> param( [switch] $SBL ) Start-Transcript -Path "c:\irnh\Install-AnyConnect.log" -Append Function CheckInstall { if (Get-Package -Name "Cisco*AnyConnect*") { return $true } else { return $false } } if ((CheckInstall) -eq $false) { try { Write-Host -ForegroundColor Yellow "Installing AnyConnect Core" $Installer = Start-Process msiexec -Wait -PassThru -ArgumentList "/i CiscoAnyConnect.msi /quiet /norestart" if (0 -in $Installer.ExitCode) { Write-Host -ForegroundColor Green "Successfully installed!" } else { Write-Host -ForegroundColor Red "AnyConnect returned error code" $Installer.ExitCode } if ($SBL) { Write-Host -ForegroundColor Yellow "Installing AnyConnect SBL" $Installer = Start-Process msiexec -Wait -PassThru -ArgumentList "/i CiscoAnyConnectSBL.msi /quiet /norestart" if (0 -in $Installer.ExitCode) { Write-Host -ForegroundColor Green "Successfully installed!" } else { Write-Host -ForegroundColor Red "AnyConnect returned error code" $Installer.ExitCode } } } catch { write-host "it no worky" } } Stop-Transcript