In the above examples, the required parameters, LoadBalancer and Credential, can be initialized before running the commands with the Initialize-LmConnectionParameters command. If you do this, it is not necessary to specify these parameters in each command.

For example:

lma = Initialize-LmConnectionParameters -Address $LMIP -Credential $creds
$lma | Format-List
ReturnCode : 200
Response   : Command successfully executed.
Data       : @{Connection=; Login=}
After the initialization, for example, the command to create a vs will became:
$vs = New-AdcVirtualService -VirtualService $VSIP -VSPort $VSPORT `
                                            -VSProtocol $VSPROTOCOL
if ($vs.ReturnCode -ne 200) {
# ERROR: exit
return $vs
}