Get-PrintConfiguration works fine in PowerShell command line. But I can't use invoke in C#.
C# code snip:
-------------------------
PowerShell ps = PowerShell.Create();
ps.AddCommand("Get-PrintConfiguration").AddParameter("PrinterName","printer");
foreach (PSObject obj in ps.Invoke())
{
......................
}
-------------------------
Error: "An error occurred while performing the specified operation"
I don't have other problem with using Powershell from C#
Any idea on how to use Get-PrintConfiguration.