I looked and it seems Dell has removed PowerGUI from their download page and I don't see it anywhere else.
I needed that to be able to get a vsphere object, put it into the object inspector, and then drill down and figure out how to call the properties on something like a VM that are hidden deep in the extension data.
What is the best tool to replace PowerGUI That allows me to do this? Can't do it with the PowerShell ISE last I checked...
Thanks!
You can do it from the ISE, but it requires some additional installs.
There is the popular Show-Object function from Lee Holmes's Windows PowerShell Cookbook.
There is ISESteroids, an add-on to the ISE.
But it comes at a price.
The PowerShell Plus editor is another free option, it allows variable inspection and drill down.
They had a new release in March 2016.
And there is another commercial option, the editor in the Sapien PowerShell Suite also allows variable drill downs.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can do it from the ISE, but it requires some additional installs.
There is the popular Show-Object function from Lee Holmes's Windows PowerShell Cookbook.
There is ISESteroids, an add-on to the ISE.
But it comes at a price.
The PowerShell Plus editor is another free option, it allows variable inspection and drill down.
They had a new release in March 2016.
And there is another commercial option, the editor in the Sapien PowerShell Suite also allows variable drill downs.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
hhave you taken a look at VScode?
I'm currently trialling VS Code, but am struggling to get debugging working properly for PowerShell.
Any tips?
What issues do you get?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I used your helpful post here: http://www.lucd.info/2016/04/23/visual-studio-code-powercli/
but couldn't get Debugging working as expected, with variables and values etc showing.
I'll set it all up from scratch as I'm not getting the following:
Can not find a PowerCLI installation!
At C:\Users\adam.rush\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1:64 char:9
+ Throw 'Can not find a PowerCLI installation!'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Can not find a PowerCLI installation!:String) [], RuntimeException
+ FullyQualifiedErrorId : Can not find a PowerCLI installation!
Not sure what I've done now!
If you installed PowerCLI 6.5R1, note that is now in a different folder ($env:ProgramFiles\VMware\Infrastructure\PowerCLI).
Could be that your $env:PSModulePath doesn't contain the correct folder.
Did you reboot after the install of PowerCLI, it sometimes takes a reboot to get the module path correct.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks all for the input.
To follow up I'm using the Sapien PowerShell tool which though expensive I like well so far.
I’ve been using Sapien PowerShell Studio (now 2016 version) for almost 3 years now. You’re right, it is a bit pricey, but at the same time, it’s very powerful. I’m having a bit of difficulty getting my VMware modules to properly show up in the tool. I’m sure that it’s something that I’m doing incorrectly, but I just can’t seem to figure out what that might be. I looked for a module directory similar to what is in PowerCLI or PowerShell, but I didn’t find one.
If anyone can point me in the proper direction, I’d be most grateful.
Which VMware modules are you referring to?
Are there modules that are not loaded when you do an Import-Module?
Are they in the $env:PSModulePath?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
When I type that into my console from PowerShell Studio, I get the following:
PS E:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2016> $env:PSModulePath
C:\Users\SE3.admin\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system
32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\;C:\Pro
gram Files\AppFabric 1.1 for Windows Server\PowershellModules;C:\Program Files (x86)\AutoIt3\AutoItX;C:\Program Fil
es (x86)\Cisco\Cisco UCS PowerTool\Modules\;C:\Program Files (x86)\NetApp\NetApp PowerShell Toolkit\Modules\.;C:\Pr
ogram Files\SharePoint Online Management Shell\;C:\Program Files\WindowsPowerShell\Modules\;C:\Program Files (x86)\
Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\;C:\Program Files (x86)\Microsoft SDKs\Azure\P
owerShell\ServiceManagement\;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage\;C:\Program Files (x86)
\VMware\Infrastructure\PowerCLI\Modules
PS E:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2016>
I located the modules folder in PowerCLI and found this list (which is what I was looking for in PowerShell Studio:
Due to lack of space on this particular server, my PowerShell Studio install is on the E: drive; however, PowerCLI and Windows PowerShell are installed on the C: drive. I believe I may have further complicated things when I recently installed the PowerShell 6.0.0 alpha (also on E: drive). Regarding the modules, they appear to successfully import, but when I go to try and write up a script or put in a simple command like Connect-VIServer, the 'intellisense' doesn't show the command and when I try to run it, the errors come from all over the place. I know that this sounds horribly confusing and I'm definitely in over my head when it comes to configuring a tool like PowerShell Studio. I'm trying to learn as I go and I'm making plenty of mistakes. That's my punishment for being away from coding for so very long. I've become addicted to PowerShell/PowerCLI because what little I do know has saved my butt many times when it comes to getting data from my vCenters (all 28 of them!!). I'm trying to learn from you and your colleagues, but I'm trying to take shortcuts to get to what I need and it's causing problems as you can see.
Thank you in advance for any guidance that you can give me on how to clean all this up.
The location where you installed PowerShell Studio shouldn't have any impact.
The $env:PSModulePath variable is an environment variable, nothing to do with PowerShell Studio.
As a quick test, do you also have the :""intellisense" problem when you use the PowerShell ISE?
Mind, it might take a while before intellisense is initialised, seen the number of modules you have in $env:PSMOdulePath.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, that's where I'm noticing it - when I'm using the ISE. If I just try typing the command in the console, once Enter is hit, I get:
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS E:\Program Files\PowerShell\6.0.0.14> Connect-VIServer VC-COR.FLOWERS.FOODS
Connect-VIServer : The term 'Connect-VIServer' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Connect-VIServer VC-COR.FLOWERS.FOODS
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-VIServer:String) [], Co
mmandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS E:\Program Files\PowerShell\6.0.0.14>
I see that the path is a hot mess. I inherited that when I got this server. I'm still working on what can be weeded out and what needs to stay. I take it that there might be a connection.
The PowerCLI modules will not auto-load.
You'll have to do from the prompt or in one the profile files.
Get-Module -Name VMware* -ListAvailable | Import-Module
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried the Get statement first. I even ran the command without the import-module portion; just so that I could see what it's supposedly loading. Everything I was looking for said it was being loaded. However, when I went to try that simple Connect-VIServer command again, it bombed just as it had before. Sorry partner - no joy yet.
And did you give intellisense sufficient time to build it's tables?
It might take a while.
The ISE should be telling that in the status bar at the bottom, and so does the Visual Studio Code editor.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I've given it approximately an hour now. I just tried again, but this time I remembered to document for you what I am seeing
Nothing shows up in Intellisense, but notice the module objects which are on the left. This would give a person the impression that they are there. Here's another thing I just noticed moments ago. Most of the modules have cmdlets in them - so far as I have noticed. However, when I clicked on any of the VMware ones, it's an empty object. That's really weird. Could that be a clue to what's going on?
I'm going to try the same thing in the PowerShell ISE and I'll document what happens there as well.
Thanks LucD. I hope I'm not becoming a PITA for you. Be right back.
Well, when I tried Windows PowerShell both the console and the ISE came back with expected results. The only strange thing there is that it is showing version 4 and I know that I upgraded that PowerShell to v5 about a month ago.
Anyway, when I went into the PowerShell 6.0 alpha, here's what resulted:
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS E:\Program Files\PowerShell\6.0.0.14> Get-Module -Name VMware* -ListAvailable
| Import-Module
Import-Module : Could not compare "6.0.0-alpha" to "3.0". Error: "Cannot
convert value "3.0" to type "System.Management.Automation.SemanticVersion".
Error: "Cannot process argument because the value of argument "version" is not
valid. Change the value of the "version" argument and run the operation
again.""
At line:1 char:43
+ Get-Module -Name VMware* -ListAvailable | Import-Module
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], RuntimeEx
ception
+ FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.Commands.
ImportModuleCommand
The type initializer for
'VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory' threw an exception.
At E:\program files\powershell\6.0.0.14\Modules\VMware.ImageBuilder\VMware.Imag
eBuilder.ps1:1 char:1
+ [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], TypeInitializationExce
ption
+ FullyQualifiedErrorId : System.TypeInitializationException
The type initializer for
'VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory' threw an exception.
At E:\program files\powershell\6.0.0.14\Modules\VMware.VimAutomation.Cis.Core\V
Mware.VimAutomation.Cis.Core.ps1:1 char:1
+ [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], TypeInitializationExce
ption
+ FullyQualifiedErrorId : System.TypeInitializationException
Import-Module : Method 'PromptForCredential' in type
'VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVmGuestRoute' from assembly
'VMware.VimAutomation.ViCore.Cmdlets, Version=6.5.0.263, Culture=neutral,
PublicKeyToken=null' does not have an implementation.
At line:1 char:1
+ Get-Module -Name VMware* -ListAvailable | Import-Module
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadExcep
tion
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Co
mmands.ImportModuleCommand
E:\Program Files\PowerShell\6.0.0.14>
This was just trying to get the VM* modules to load. I'm nearly tempted to remove everything and reinstall v5 and reinstall PowerShell Studio. However, I'll have to wait until the next server I build. I'm not the only one using this server remotely so I don't wish to miss anyone else up.
I hope that you're able to diagnose whatever stupid thing I did. It's a bit frustrating.
You shouldn't be mixing PowerCLI 6.5R1 and PowerCLI Core, these are not compatible.
You can install them on the same machine, but you can't load for example the PowerCLI Core modules in PowerShell v5.
In those editors can you do a Get-Module, just to check what is actually loaded?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference