Archive

Archive for May, 2010

Beyond Export-Csv: Export-Xls

May 29th, 2010 61 comments

Warning: this post has no “virtual” content !

This time I post a function that allows you to export your data to a “real” spreadsheet (XLS format) instead of a CSV file.

The reason for posting this function was a series of threads in the PowerCLI Community by Suresh. Over several threads he has been collecting scripts that create various reports on his vSphere environment. Ultimately he wanted to have a spreadsheet where each report would be stored on a worksheet.

PowerShell has the very handy Export-Csv cmdlet to create CSV files but afaik nothing for creating XLS files :-(

Read more…

Categories: PowerShell, Spreadsheet Tags: , ,

NX/XD flag setting report

May 13th, 2010 3 comments

Michael asked if it was possible to produce a report that showed the NX/XD flag setting for all the guests.

Piece of cake I thought, but it turned out to be a bit more complex than that. If you don’t set the NX/XD flag (expose or hide) explicitly on the guest, the hyper-visor will use a default that is defined per OS you can have on the guest.

In the end I think I came up with a script that seems to handle all the different possibilities I encountered.

Read more…

Categories: CPU, PowerShell, vSphere Tags: , ,

Debugging function – verbose vpxd logging

May 12th, 2010 No comments

Today Steve Jin published a post called How to Enable ESX Server Logs for Troubleshooting. A very useful tip when you are looking for those hard-to-find “features” in your script.

Steve’s tipĀ  reminded me that I have a similar small function in my toolchest to do something similar for the vCenter log.

The function allows you to switch the vCenter log between “warning” and “verbose” on the fly. No need to go into the vCenter client to change the logging option anymore while debugging.

Read more…

Categories: PowerCLI, PowerShell, vSphere Tags: , ,

Changing VMware Tools scripts

May 7th, 2010 No comments

There was another interesting question on the PowerCLI community. Mike was wondering if it would be possible to change the VMware Tools scripts with a PowerCLI script. As far as I can see there are two options available with the VMware Tools scripts.

  1. You can run the default scripts that are installed on the guests when you install VMware Tools
  2. You can use Custom scripts and you have to specify the path of these scripts to VMware Tools

To use the 2nd option you will need, as William already pointed out, the VIX APIs.

But if you can live with the first option, and reuse the default scripts, the current PowerCLI build has all you need.

Read more…

Categories: PowerCLI, PowerShell, Tools Tags: , ,

We’re writing a book!

May 4th, 2010 15 comments

Some of you might be interested to know, Alan and Luc are writing a PowerCLI book.

We don’t have many more details at the moment but wanted to let you know, as we are both very excited (and nervous by the amount of work) about this project.

As you know we both live and breathe PowerCLI. And we want to share our knowledge to help others achieve the level of PowerCLI automation we both know is possible.

One thing you can expect from this book is a practical approach with examples galore. We aim to cover most of the common configuration/troubleshooting and reporting areas with easy to understand examples and explanations.
Read more…

Categories: Book, PowerCLI, PowerShell Tags: ,