had to stay working all night so I have tested the Add-Type in both Window 7 (V2b), WS08 (CTP3), and Vista (CTP3). I'm still getting the error.
Windows 7 has SQL Server 2008 and SQL Server Express 2008 with the SMO SQL 2008 feature pack - fail
Windows Server 2008 has only one SQL Server 2008 Enterprise with the SMO SQL 2008 feature pack - fail
Windows Vista have all three SQL Servers (2K, 2K5, and 2K8) with the SMO SQL 2008 feature pack - fail
Windows Server 2003 with PowerShell (CTP2), SQL Server 2000 and SQL Server 2005 SMO Feature pack - WORKS GREAT!
The clue on this message is that, on machine with SQL 2008, the error will come up "...'Microsoft.SqlServer.Smo, Version=126.96.36.199".
This is for SQL Server 2005. It should be "..., Version=10.0...". Why?? it most be a bug only with SQL Server 2008.
Here's the error again:
PS C:\> Add-Type -a "Microsoft.SqlServer.Smo"
Add-Type : Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=188.8.131.52, Culture=neutral, Publ
=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
At line:1 char:9
+ Add-Type <<<< -a "Microsoft.SqlServer.Smo"
+ CategoryInfo : NotSpecified: (:) [Add-Type], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand
Any other comments??