You could use LoadWithPartialName
. However, that is deprecated as they said.
You can indeed go along with Add-Type
, and in addition to the other answers, if you don't want to specify the full path of the .dll file, you could just simply do:
Add-Type -AssemblyName "Microsoft.SqlServer.Management.SMO"
To me this returned an error, because I do not have SQL Server installed (I guess), however, with this same idea I was able to load the Windows Forms assembly:
Add-Type -AssemblyName "System.Windows.Forms"
You can find out the precise assembly name belonging to the particular class on the MSDN site: