I have code that calls a PowerShell script to copy 1 user's groups and apply them to another user in Active Directory. I can run the script fine in a PowerShell, but when I try to call it from the code, I get an error that reads:
Cannot convert null to type "System.ConsoleColor" due to invalid enumeration values. Specify one of the following enumeration values and try again...
I have been able to launch scripts to find a user from AD and that works. There is a group (Domain Users) that exists for both users and it throws an error, but continues through the rest of the groups.
I think my problem has something to do with this error, but I don't know how to handle that from the PowerShell side.