Forum Discussion
dan_03_140075
Nimbostratus
Apr 03, 2014Passing credential to New-Object iControl.Interfaces
Hello, big fan of powershell and icontrol. The F5 DevCentral has been awesome to get up and running. I have been using
$cred = (get-credential)
Initialize-F5.iControl -HostName $g_bigip -credentials...
dan_03_140075
Nimbostratus
Apr 22, 2014$user = $cred.Username;
$pass = $cred.GetNetworkCredential().Password;
$g_bigip = "dev1"
$ic = New-Object iControl.Interfaces
$ic.initialize($g_bigip, $user, $pass);
True
$ic.SystemSystemInfo.get_uptime();
4475412
$ic = $null
$ic.SystemSystemInfo.get_uptime();
You cannot call a method on a null-valued expression.
At line:1 char:1
+ $ic.SystemSystemInfo.get_uptime();
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
$cred = (get-credential)
$global:g_bigip = "dev1"
$global:success = Initialize-F5.iControl -HostName $global:g_bigip -credentials $cred;
(Get-F5.iControl).SystemSystemInfo.get_uptime();
4475650
$global:success = $null
(Get-F5.iControl).SystemSystemInfo.get_uptime();
4475663
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects