Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral


Downloads

 Loading

When we shipped DC4, we started looking at Windows PowerShell and how we could build some integration points with our products. The first pass was a set of PowerShell script files that we introduced in the PowerShell Labs section of DevCentral. No soon after we posted them, the requests started pouring in on when we would provide some native PowerShell CmdLets in addition to the function scripts.

Well, I spent a little bit of time working some out and whipped out a good first rough draft. I've been holding on to these for a while now but figured they would do better out in the wild then trapped in a folder on my laptop.

So, last night I posted an installer for the first release of the iControl CmdLets for PowerShell. I also ran some screen captures on how to install and use the CmdLets but ended up with some technical difficulties with the screen capture software - Camtasia is now on order B-). So, once I can get a good capture, be on the lookout. In the mean time, here's a step by step on getting up and running with the new bits.

Download and install PowerShell from Microsoft
Go to the PowerShell Labs page on DevCentral and select the "Download Now" link.  This will download the Cmdlet installer.
Run the iControlSnapInSetup.msi installer.  This will install the SnapIn into the c:\program files\F5 Networks\iControlSnapIn directory.

Start PowerShell from the Windows Start menu.
Cd to c:\program files\F5 Networks\iControlSnapIn directory
Dot Source the setup script (only once after the install)
PS > . .\setupSnapIn.ps1)

Load the SnapIn into the Runtime
PS > Add-PSSnapIn iControlSnapIn

Initialize the iControl connection with the Initialize-F5.iControl CmdLet
PS > Initialize-F5.iControl -Hostname bigip_address -Credentials (Get-Credential)

Run the Get-F5.iControlCommands CmdLet to list out all the available Cmdlets.
PS > Get-F5.iControlCommands

Try out some of the CmdLets
PS > Get-F5.LTMPool

That should be about it. Hopefully I'll automate some of the setup procedures into the installer (if anyone knows how to get the Installer Project in VS.Net to include a shortcut to a non-project item, please let me know B-).

Are the cmdets able to work with resources in partitions other than common? For example, Get-F5.LTMPool only shows pools in the /Common partition and I didn't see a parameter for it or Initialize-F5.iControl to switch partitions.

I got an "installation failed" error when following the above instructions (my notes in ALL CAPS below): PS C:\> cd 'C:\Program Files\F5 Networks\iControlSnapIn' cd : Cannot find path 'C:\Program Files\F5 Networks\iControlSnapIn' because it does not exist. ***NOTE: IF YOU ARE ON A 64-BIT VERSION OF WINDOWS, THE PATH WILL USE "Program Files (x86)" PS C:\> cd 'C:\Program Files (x86)\F5 Networks\iControlSnapIn' PS C:\Program Files (x86)\F5 Networks\iControlSnapIn> . .\setupSnapIn.ps1 Registering iControlSnapin.dll on platform '' Microsoft (R) .NET Framework Installation utility Version 2.0.50727.5420 Copyright (c) Microsoft Corporation. All rights reserved. The installation failed, and the rollback has been performed. Registering iControlSnapin.dll on platform '64' Microsoft (R) .NET Framework Installation utility Version 2.0.50727.5420 Copyright (c) Microsoft Corporation. All rights reserved. The installation failed, and the rollback has been performed. *** NOTE: INSTALLATION FAILED BECAUSE YOU NEED TO RUN AN ADMINISTRATIVE POWERSHELL PROMPT IF UAC IS ENABLED. FIND YOUR POWERSHELL PROMPT FROM THE START MENU (Start --> All Programs --> Accessories --> Windows PowerShell), RIGHT-CLICK ON THE "Windows Powershell" PROGRAM ICON AND CHOOSE "Run as administrator". THEN PERFORM THE INSTALLATION STEPS IN THE ARTICLE ABOVE.


3 Version(s):

added 2 months ago
added 4 months ago
added 8/10/2013