Hi All,
Any idea how to get the get-visession cmdlet running? Its not recognized in my machine as valid cmdlet.
I see that its available in 5.0.1 onwards as per blog http://blogs.vmware.com/vipowershell/vcenter/
I also confirmed that my version is 5.0.1 (see below)
I need this to check the number of sessions connected to VC periodically. Any help would be appreciated.
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.0.1 build 581491
---------------
Snapin Versions
---------------
VMware AutoDeploy PowerCLI Component 5.0 build 544967
VMware ImageBuilder PowerCLI Component 5.0 build 544967
VMware vCloud Director PowerCLI Component 1.5 build 581492
VMware License PowerCLI Component 5.0 build 544881
VMware vSphere PowerCLI Component 5.0 build 581435
You can save the function Get-ViSession from the blog-post in a file, e.g. Get-ViSession.ps1. After that you can dot-source that file:
. .\Get-ViSession.ps1
to add the function to your session.
You can also add the function to your PowerShell profile with:
notepad $profile
Regards, Robert
The Get-VISession the blog post refers to is a function, not a cmdlet.
Store the code from the blog post in a .ps1 file, then dot-source the .ps1 file
. ./file.ps1
Note that there is a blank between the 2 dots !
Now you can call the Get-VISession function.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can save the function Get-ViSession from the blog-post in a file, e.g. Get-ViSession.ps1. After that you can dot-source that file:
. .\Get-ViSession.ps1
to add the function to your session.
You can also add the function to your PowerShell profile with:
notepad $profile
Regards, Robert