PowerShell ps = PowerShell.Create();
PSCommand cmd1 = new PSCommand();
cmd1.AddCommand("Grant-CsTenantDialPlan")
.AddParameter("Identity", "xxxx.yyyy@xxxxx.com.tr")
.AddParameter("PolicyName", "DialPlan-GMMA");
ps.Commands = cmd1;
ps.Invoke();
I'm not sending the PolicyName parameter empty. But why am I still getting the error?
Stack Trace:
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection
1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection
1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke()
at ConnectTeams.Program.Main(String[] args) in C:\Projects\ConnectTeams\ConnectTeams\Program.cs:line 120