anyconnect - use get-package
This commit is contained in:
@@ -2,10 +2,14 @@
|
||||
# Technolog Networks - 2025-10-13
|
||||
# iRaven
|
||||
|
||||
param(
|
||||
[switch] $SBL
|
||||
)
|
||||
|
||||
Start-Transcript -Path "c:\irnh\Install-AnyConnect.log" -Append
|
||||
|
||||
Function CheckInstall {
|
||||
if ((Get-Package -Name "Cisco*AnyConnect*")) {
|
||||
if (Get-Package -Name "Cisco*AnyConnect*") {
|
||||
return $true
|
||||
} else {
|
||||
return $false
|
||||
@@ -14,8 +18,12 @@ Function CheckInstall {
|
||||
|
||||
if ((CheckInstall) -eq $false) {
|
||||
try {
|
||||
Write-Host -ForegroundColor Yellow "Installing AnyConnect Core"
|
||||
msiexec /i ".\CiscoAnyConnect.msi" /quiet
|
||||
msiexec /i ".\CiscoAnyConnectSBL.msi" /quiet
|
||||
if ($SBL) {
|
||||
Write-Host -ForegroundColor Yellow "Installing AnyConnect SBL"
|
||||
msiexec /i ".\CiscoAnyConnectSBL.msi" /quiet
|
||||
}
|
||||
} catch {
|
||||
write-host "it no worky"
|
||||
}
|
||||
|
Reference in New Issue
Block a user