Every once in a while I check-up on Hal Rottenbergās weblog TechProsaic. Just curious if his upcoming PowerShell book is available yet. Halās last post mentions a Community tread which contains a script to install the VMware tools on a bunch of virtual machines without rebooting them. Here is the PowerShell script.
$cluster = "< >" # Enter the required cluster name
$installerArgs = 'REBOOT="ReallySuppress"'
Get-Cluster -Name $cluster | Get-VM | % { (Get-View $_).UpgradeTools_Task($installerArgs) }
Wednesday, November 19. 2008
How to install VMware tools without a reboot
Tuesday, November 18. 2008
Speaker Idol Finalist - Dimitry Sotnikov
Sunday, November 9. 2008
Creating a PowerShell GUI with PrimalForms
In this article Iāll give you a short demo how easy it is to create a PowerShell user interface with the free PrimalForms from Sapien.Ā At the 4th of November Sapien released their first public version of PrimalForms. Jeffery Hicks over at Sapien reportsĀ :
I hope you are as excited about the release of PrimalForms as I am. In the past creating a Windows form in PowerShell was a very tedious task and one I rarely used except for the most simplest of forms. No more. The free PrimalForms tool lets me create a very rich Windows form using a WYSIWYG editor. I can export the form to a file, add my PowerShell code and call it a day.
First download PrimalForms at Sapienās the free tools section. After installing, you just create a wonderful user interface and copy the PowerShell scriptĀ code to your clipboard.
In this example I created a button and a multiline text field. I copied my code to the PowerGui script editor and added a few lines of my own code.Ā The following two lines are added to the top of the script.
Get-PSSnapin -registered | Add-PSSnapin -passthru -ErrorAction SilentlyContinue
$Server = Connect-VIServer -Server 192.168.75.128 -User root -Password vmware
When you walk through the script youāll see the sections where you can add your own code. In this example I added the following code under the button.
#Provide Custom Code for events specified in PrimalForms.
$button1_OnClick=
{
#TODO: Place custom script here
$textBox1.text = Get-VM
}
And hereās the result.
Saturday, November 8. 2008
Enabling the VI Toolkit Extensions
The PowerShell sessions at the VMworld were a big hit, VMware even had to upgrade the session rooms because of the high reservation numbers. Carter Chanklin, Product Manager atĀ VMware's End User Enablement,Ā recently started a new initiative, the VI toolkit extensions.
I'm really excited about the VI Toolkit Extensions as a way for us to make the common problems we see on our forums really easy to do. Just today, a user wanted to find all files on his datastores that contain the word "delta" (which can indicate a snapshot that hasn't been cleaned up properly). As it turns out, with the extensions this is just a one-liner. The art of PowerShell really seems to be the art of the one-liner and with the extensions there are already a lot of great one-liners you can use.
Hereās a short āhow toā use the extensions:
Upgrade to Windows PowerShell 2.0 Community Technology Preview (CTP2).
Download Download the VI Toolkit (for Windows) 1.0.
Download the viToolkitExtension.psm1 module at Codeplex and place it somewhere on your local disk (I placed mine in c:\temp).
Start gPowerShell.exe (new in PowerShell 2.0) and paste the following code in the bottom window.
Add-Module "C:\Temp\viToolkitExtensions.psm1"
Get-PSSnapin -registered | Add-PSSnapin -passthru -ErrorAction SilentlyContinue
$Server = Connect-VIServer -Server 192.168.75.128 -User root -Password vmware
get-TkeOrphanedVmdk
When you take a look at the contents of the psm1 file thereās an interesting section : Half-baked stuff | New-OpenfilerIscsi.