In PowerShell you easley can test a registry key with the cmdlet Get-ItemProperty.

PS C:\> $key = $(Get-ItemProperty «HKLM:\SOFTWARE\LJS»).LarsJostein -eq «Silihagen»
PS C:\> $key
True
PowerShell example where you test the installed Operations Manager Console version:
function OpsMgrVer
{
return $ver = $(Get-ItemProperty «HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup»).CurrentVersion
}
function TestVersion
{
$nr = OpsMgrVer
if (OpsMgrVer -ge «6.0.6270.0″)
{ Write-Host «SCOM 2007 SP1 is installed. ServerVersion: $nr» } else { Write-Host «SCOM 2007 SP1 is not installed. ServerVersion: $nr» }
}
Friday 29th August I was glad for passing the exam 70-401 TS: Microsoft System Center Configuration Manager 2007, Configuring . In June I took the exam 70-400 TS: Microsoft System Center Operations Manager 2007, Configuring. So now I am waiting for the 70-403 exam to become MCITP in System Center, but I’m not sure when Microsoft will release the 70-402 exam.
Links:
Operations Manager: http://www.microsoft.com/learning/en/us/exams/70-400.mspx
Configuration Manager: http://www.microsoft.com/learning/en/us/exams/70-401.mspx
Last week I worked with a PowerShell script where I did a big blunder! I had created a function with the name “Start” and I did not find the reason of why my script failed before at least one hour. Start is one of the PowerShell reserved verbs so stay away from them in your function names or variables!
List of reserved PowerShell verbs at Microsoft: http://msdn.microsoft.com/en-us/library/ms714428.aspx
Or you can of course list the verbs with PowerShell:
$verbs = [System.Reflection.Assembly]::LoadWithPartialName(«System.Management.Automation»)
$verbs.GetTypes() | where {$_.Name -match «Verbs»} | foreach {$_.GetFields() | foreach {$_.Name}} | sort
DirectionsonMicrosoft.com has written and created a nice illustration of the System Center Product Timeline.
Link: http://www.directionsonmicrosoft.com/sample/DOMIS/update/2008/06jun/0608smpr_illo.htm
With the VI toolkit you can automate standard management tasks like cloning, moving, starting or stopping virtual machines and hosts true PowerShell. VI Toolkit takses advantage of the exisiting VMware Infrastructure SDK and translate it into a PowerShell interface.
http://www.vmware.com/sdk/vitk_win/index.html?src=EM_0803_VMW_OTHER_VITOOLKIT_DOWNLOAD
After you have installed PowerShell and VI Toolkit on your computer, you have to add the VI Toolkit powershell snapin:
# List the snappins you allready have installed:
PS C:\> get-pssnapin
# List registered snapins:
PS C:\> Get-PSSnapin -Registered
# Add the VMware.VimAutomation.Core snappin:
PS C:\> Add-PSSnapin VMware.VimAutomation.Core
# Connect to your Virtual Center server:
PS C:\> Get-VIServer x.x.x.x -User admin -Password xxxxxxx
# List virtual maschines who are powered on:
PS C:\> get-vm | Where-Object {$_.powerstate -eq ‘PoweredOn’}
For those of you who wish to learn or read more about PowerShell I will recommend the book PowerShell in Action by Bruce Payette. Bruce Payette is one of the co-designers of the PowerShell language. The book contents great examples and is easy readability.

PowerShell in Action
http://manning.com/payette/
Release higlights:
- Support for Quad-Core AMD Opteron 8300 and 2300 series processor families (codename Barcelona)
- Support for Dual-Core Intel Xeon 5200 series processors (codename Wolfdale)
- Enhanced patch management
- Support for new / updated guest OS; Windows 2003 R2 Data Center Edition and Red Hat Enterprise 5.1
- Update for service console from RHEL3 U8 to RHEL3 U9
http://www.vmware.com/support/vi3/doc/releasenotes_esx303.html#resolvedissues
PowerShell statements can be large, and it’s not always practial to enter it on a single line in the console or in a script. In PowerShell, as wel as in most other programming lanuages or consoles it is posible to write statements over several lines.
When the console determines a line is incomplete, powershell continues to the next line processing the statement. For example, where the first line in a statement ends with the pipe operator, as in:
Long statement example:
18# Get-Process | Where {$_.ProcessName -eq ‘msiexec’} | Format-table ID, CPU, Name
Id CPU Name
– — —-
4808 0,046875 msiexec
Same statemen over three lines:
19# Get-Process |
>> Where {$_.ProcessName -eq ‘msiexec’} |
>> Format-table ID, CPU, Name
>>
Id CPU Name
– — —-
4808 0,046875 msiexec
In a PS1 script you can use the ` tag:
$excel = New-Object -comobject `
excel.application
Guidance on best practices of VMware Virtual Infrastructure:
http://www.vmware.com/overview/security/best_practices.html
Security implications of the Virtual Data Center:
http://www.malanmurphy.com/Security_Implications_of_the_Virtual.pdf
Security technical implementation guide (Department Of Defense USA)
http://iase.disa.mil/stigs/stig/esx_server_stig_v1r1_final.pdf
I would also recommend to read the whitepaper VMware VI Architecture Overview:
http://www.vmware.com/pdf/vi_architecture_wp.pdf