c#Powershell交换多值cmd参数传递
我想在c#循环中运行以下内容,但我不知道如何用逗号传递参数的多值。实际的cmdlet如下所示,并且在exchange powershell中工作: 设置日历处理–ResourceDelegatesjonDoe@test.com,johnnydoe@test.com-身份testroom@test.com–自动处理自动更新 我知道我的代码连接可以工作,但它是“–ResourceDelegates”jonDoe@test.com,johnnydoe@test.com“我不知道如何通过,如下所示: 代码的示例部分如下所示:c#Powershell交换多值cmd参数传递,c#,powershell,exchange-server,C#,Powershell,Exchange Server,我想在c#循环中运行以下内容,但我不知道如何用逗号传递参数的多值。实际的cmdlet如下所示,并且在exchange powershell中工作: 设置日历处理–ResourceDelegatesjonDoe@test.com,johnnydoe@test.com-身份testroom@test.com–自动处理自动更新 我知道我的代码连接可以工作,但它是“–ResourceDelegates”jonDoe@test.com,johnnydoe@test.com“我不知道如何通过,如下所示: 代
command.AddCommand("Set-CalendarProcessing");
command.AddParameter("-ResourceDelegates", "userA@test.com,userB@test.com");
command.AddParameter("-Identity", "test@test.com");
command.AddParameter("-AutomateProcessing", "AutoUpdate");
谢谢
史蒂夫试试这个:
command.AddParameter("ResourceDelegates", new string[] { "a@b.c", "b@d.f" });
因此,如果需要参数的多个参数,请在参数名称前面加上连字符并传递数组。将数组作为参数传递的最佳方法是什么,可以使用PassArray(数组)吗?我不明白。我的示例是传递字符串[]数组。