Pergunta

Why does this work:

$cmd = new-object System.Data.OleDB.OleDbCommand

and why doesn't this:

$sql = new-object Microsoft.SqlServer.SMO

How do I know which classes need this "special" treatment?

Nenhuma solução correta

Outras dicas

SMO isn't a class, it's a namespace. You need to instantiate an object in the namespace. For instance, if you wanted a server, you'd do:

$server = new-object Microsoft.SqlServer.Management.Smo.Server "yourServer";
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top