SQL 2008 PowerShell Provider/SMO 10.0

Coordinator
Sep 9, 2008 at 9:34 PM
I noticed some issues with SMO 10.0 and I've logged a bug with Connect

I've used a workaround by loading 9.0 SMO, change this line in LibrarySMO.ps1 from 
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") > $null
to
[reflection.assembly]::Load("Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91") > $null

I've also been playing around with the SQL 2008 PowerShell provider and I used this script from an msdn blog adding it to my profile to load the provider. I noticed the provider format and type data does some odd things when you display SMO data in PowerShell. For example if you run Get-SQLDatabase you only see a very small subset of properties displayed and Get-SQLServer will return an empty instance name property. You may want to avoid sourcing the SQL 2008 PowerShell provider in your profile. After removing the call to the msdn script the SMO data returned was what I expected. For now I'm only sourcing the SQLPSX script in my PowerShell profile.

Coordinator
Jan 25, 2009 at 1:43 AM
I"ve been meaning to post a follow up to this issue. The SMO 10.0 issue with enumerating server properties doesn't seem to be that big of deal as I've using SMO 10.0 over 9.0 for several months without issue.