Forum Discussion
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
Recent Discussions
Related Content
* 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