I can't seem to run a command like this one...
pshell.AddCommand("(New-Object -ComObject WScript.Network).AddWindowsPrinterConnection(" + strShare + ")");
...without getting an error saying that it cannot find the module. It's expecting me to use something like
pshell.AddCommand("New-Object");
pshell.AddArgument("-ComObject");
pshell.Invoke();
How can I use that format with a command like this?