Frage

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?

Keine korrekte Lösung

Andere Tipps

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";
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top