SQLPSX with pure 2012

Developer
Dec 18, 2012 at 4:19 AM

when using sqlpsx in a host without 2008 r2

it happens "Cannot find type [Microsoft.SqlServer.Management.Common.ServerConnection"

 

then I need to modify SQLServer.psm1 with 

 

try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA continue}catch {    try {add-type -AssemblyName "Microsoft.SqlServer.SMOExtended, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}    catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"}}
try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA continue}catch {    try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop; $smoVersion = 10}    catch {add-type -AssemblyName "Microsoft.SqlServer.Smo"; $smoVersion = 9}
}
try{    try {add-type -AssemblyName "Microsoft.SqlServer.SMOExtended, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA continue}    catch {        try {add-type -AssemblyName "Microsoft.SqlServer.SMOExtended, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}        catch {add-type -AssemblyName "Microsoft.SqlServer.SMOExtended" -EA Stop}    }}catch {Write-Warning "SMOExtended not available"}

Developer
Dec 18, 2012 at 4:20 AM

BTW,

smoextented error is as the previous post