سؤال

أنا أكتب بعض البرامج النصية للرسائل الموحدة للرسائل الموحدة. أحاول أتمتة خطط UM Dial لخوادم UM. أمر PowerShell هو:

[PS] E:\Scripts>Set-UmServer -id Exchange01 -DialPlans "test1", "test2"

عندما أحاول حل البرمجة النصية التالية:

[PS] E:\Scripts>$str = "`"test1`", `"test2`""
[PS] E:\Scripts>Set-UmServer -id Exchange01 -DialPlans $str

أحصل على خطأ:

The UM dial plan "test1", "test2" doesn't exist.
+ CategoryInfo          : NotSpecified: (0:Int32) [Set-UmServer], ManagementObjectNotF
+ FullyQualifiedErrorId : 7AF43AA1,Microsoft.Exchange.Management.Tasks.UM.SetUMServer

شعوري هو أنني أتعامل مع المتغير بشكل غير صحيح وأن المتغير هو تبديل "Test1" ، "Test2" "بدلاً من" Test1 "،" Test2 ".

أي ارشاد سوف يكون مشكورا.

مع تحياتي

جون

هل كانت مفيدة؟

المحلول

أنت تتفوق عليه. :-) جرب هذا:

$str = "test1", "test2"
Set-UmServer -id Exchange01 -DialPlans $str 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top