مشاكل البرمجة النصية للمشاكل ل set-umserver cmd دع
-
28-09-2019 - |
سؤال
أنا أكتب بعض البرامج النصية للرسائل الموحدة للرسائل الموحدة. أحاول أتمتة خطط 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
لا تنتمي إلى StackOverflow