Snap-in installed but cmdlets not visible
So I have the snapin installed and have a script that starts off with this code, straight from examples here
if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null )
{
Add-PSSnapIn iControlSnapIn
}
$success = Initialize-F5.iControl -HostName $bigip -Username $user -Password $pass
I run it the first time and everything works fine. Subsequent times I get this error:
Get-Command : The term 'iControlSnapIn' is not recognized as the name of a cmdlet, function, script file, or operable program.
The first command works and the snap-in is detected:
Name : iControlSnapIn
PSVersion : 2.0
Description : iControl Snap-in for F5 Device Management
but it won't let me call the cmdlets. Any idea why?