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