How to find out what’s new in OM12 for PowerShell
This week I started to play with Windows 8 and of course one of the first things I looked for was PowerShell 3.0 And then I found a great blogpost on the PowerShellMagazine website by Shay Levy where he shows how find all the changes between the two versions of PowerShell (v2 and v3).
That’s when I thought why not use the same approach for finding the changes between the OpsMgr 2007 R2 PowerShell Commands and the OM12 PowerShell Commands.
This is the script I slightly modified to get it to work for OpsMgr 2007 and OM12.
# Compare differences OpsMgr 2007 PowerShell Commands and OM 12 PowerShell Commands. # Idea and initial script from Shay Levy on PowerShellMagazine. (https://www.powershellmagazine.com/2011/09/15/how-to-find-out-whats-new-in-powershell-vnext) # Small changes by Stefan Stranger # Date: 21-09-2011 #Run in OpsMgr 2007 Command Shell Get-Command -Module Microsoft.EnterpriseManagement.OperationsManager.Client | Select-Object -Property Name,@{Name='Parameters';Expression={(Get-Command $_).Parameters.Keys}} | Export-Clixml d:\temp\opsmgr2007.xml #Run in OM12 Command Shell Get-Command -Module OperationsManager | Select-Object -Property Name,@{Name='Parameters';Expression={(Get-Command $_).Parameters.Keys}} | Export-Clixml d:\temp\om12.xml # run either in OpsMgr2007 or OM12 console $OpsMgr2007 = Import-CliXml d:\temp\opsmgr2007.xml | Sort-Object -Property Name $OM12 = Import-CliXml d:\temp\om12.xml | Sort-Object -Property Name Compare-Object $OpsMgr2007 $OM12 -Property Name -IncludeEqual -PassThru | ForEach-Object { $Command = $_ if($_.SideIndicator -eq ‘==’) { $Command = $_ $cOpsMgr2007 = $OpsMgr2007 | Where-Object {$_.Name -eq $Command.Name} | Select-Object -ExpandProperty Parameters $cOM12 = $OM12 | Where-Object {$_.Name -eq $Command.Name} | Select-Object -ExpandProperty Parameters $compare = Compare-Object $cOpsMgr2007 $cOM12 if($compare) { try { $NewParameters = $compare | Where-Object {$_.SideIndicator -eq ‘=>’} | ForEach-Object {$_.InputObject + ‘ (+)’} $RemovedParameters = $compare | Where-Object {$_.SideIndicator -eq ‘<=’} | ForEach-Object {$_.InputObject + ‘ (-)’} “$($command.Name) (!)” $NewParameters + $RemovedParameters | Sort-Object | ForEach-Object { “`t$_”} “`n” } catch{} } } elseif($_.SideIndicator -eq ‘=>’) { “$($Command.name) (+)`n” } else { “$($Command.name) (-)`n” } } |
OpsMgr 2007 Command Shell
OM12 Command Shell
Legend
> Changed
+ > New
- > Removed
|
Most of the changes are changes in the noun naming convention Example: Get-Alert is changed in Get-SCOMAlert.
Have fun!
Comments
- Anonymous
January 01, 2003
I see Jeffrey Snover's talk of qualified nouns made its way to the SCOM team. :)