Forum Discussion

RuiF_149772's avatar
RuiF_149772
Icon for Nimbostratus rankNimbostratus
May 15, 2014

How to Hide iControl Exception

I am working with a BIG-IP 10.2.4 Build 771.3 Engineering Hotfix HF6 utilizing Powershell and using iControlSnapInSetup_56.

 

My goal is to create a Powershell script, fed via a csv file with member relevant data, which allows to enable disable pool members, and that is working fine.

 

However the issue I have ran into is an exception thrown by iControl which I cannot hide no matter what I have attempted thus far. In the image below you can see the exact error:

 

I have attempted Try{}Catch{}, traps and even the ErrorAction settingsd to no avail; if the action attempted fails, the error will be printed to the Host no matter what. I know the IP address is wrong :), but the goal is to test things with possible errors, because users do provide bogus data or fat-finger data at times.

 

Thank you for your help and time.

 

  • Hi!

    Tried to set the error action "globally" before running the command?

    $ErrorActionPreference = "SilentlyContinue"

    To restore to default state:

    $ErrorActionPreference = "SContinue"

    /Patrik