I wanted to output some data with PowerCLI using the Out-GridView cmdlet. Reason for using this cmdlet is that I needed to create an index for the .vmdk’s attached to the virtual machines and the number varies, however I encountered the following error on my system:
Out-GridView : To use the Out-GridView cmdlet, install the Windows PowerShell Integrated Scripting Environment feature from Server Manager. (Could not load file or assembly ‘Microsoft.PowerShell.GraphicalHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.)
After some troubleshooting I discovered that this can be resolved easily by installing PowerShell ISE, which is an optional feature and requires .Net 3.5 SP1, to install this on Windows Server 2008 R2, use the Add Features Wizard or run the following Powershell command:
Import-Module ServerManager; Add-WindowsFeature PowerShell-ISE
-ray
You might also want to watch out for this little tip with Out-Gridview, it had me going for a while…
http://www.virtu-al.net/2009/11/17/powershell-gotcha-export-csv-out-gridview-and-others/
I didn’t previously know about the out-gridview cmdlet so I took great interest in this. However, what really drew my eye to this post was the line, “create an index for the .vmdk’s attached to the virtual machines”.
What progress have you made on this front? I am have also been looking at ways of reclaiming disk space and in a more efficient manor then looking at dates/last changes.
Any pointers in the right direction on identifying unused .vmdks would be great!
Thank you very much indeed.
Thanks a lot, it helps me a lot.
Thanks. Saved me a lot of time 🙂