Forum Discussion
Richard_Milner-
Aug 15, 2012Nimbostratus
That's just what I was after Joe, thanks. In case it's of any use to anyone:
-------------------------------------------------------------------------
function Create-OneConnectProfile()
Check whether a OneConnect Profile exists, create it if required
-------------------------------------------------------------------------
{
Param([string] $profileName);
$OneConnectArray = @()
$OneConnectArray = (Get-F5.iControl).LocalLBProfileOneConnect.get_list()
If ($OneConnectArray -contains $profileName) {
Write-Host "OneConnect Profile: $profileName already exists" -ForegroundColor Cyan
} Else {
try {
(Get-F5.iControl).LocalLBProfileOneConnect.Create( $profileName )
Write-Host "Created OneConnect Profile: $profileName" -ForegroundColor Green
} catch {
Write-Host "There was an exception thrown creating OneConnect Profile: $profileName" -ForegroundColor Red
$Error[0]
}
}
}