Home

Array not supported?

Frequent Contributor

Array not supported?

Will this say that Array is not supported by set-CsRGSHolidayset?

DGD_M-QXcAAbMoM.jpg

7 Replies

Re: Array not supported?

The right way to add is descibred here: https://technet.microsoft.com/en-us/library/gg398736.aspx

 

The following example is what you are looking for:

$x = New-CsRgsHoliday -StartDate "12/25/2010" -EndDate "12/26/2010" -Name "Christmas Day"
$y = Get-CsRgsHolidaySet -Identity "service:ApplicationServer:atl-cs-001.litwareinc.com" -Name "2010 Holidays"
$y.HolidayList.Add($x)
Set-CsRgsHolidaySet -Instance $y

 

Re: Array not supported?

I know about this, but problem is that you cant use .Add($x) on a Array.

Need to use something like $Array += $newArray.

I tried with Add-member now, and was sucessfull to add data to the variable.

But when i try to use it in Set-CsRGSHolidayset it does nothing.

 

1.PNG2.PNG

Re: Array not supported?

That is not support by that cmdlet. It has the be of the type holidayset

Re: Array not supported?

Strange, as it works for new-csrgsholidayset :-/

Re: Array not supported?

According to the documentation is does indeed
https://technet.microsoft.com/en-us/library/gg398403.aspx
I guess it is a different cmdlet

Re: Array not supported?

The error message says that it can't convert your untyped (object[]) array to the required type.

Try to specify the type for array elements:

[Microsoft.Rtc.Rgs.Management.WritableSettings.Holiday[]]$HolSetArray = @();
$HolSetArray += New-CsRgsHoliday -StartDate "2017-01-01T00:00:00" -EndDate "2017-01-01T23:59:59" -Name "New Year's Day"
$HolSetArray += New-CsRgsHoliday -StartDate "2017-12-26T00:00:00" -EndDate "2017-12-26T23:59:59" -Name "Christmas Day"

Highlighted

Re: Array not supported?

Sorry for not getting back to this post. I ended up doing it like this:
array.PNG

Related Conversations
UK code support PSTN Calling
SB V  in  Skype for Business IT Pro  on
2 Replies
Office 2016 or Office 365?
Gerald McDaniel  in  Office 2007  on
3 Replies
Customer Manager Button in Outlook Not Active
Vik Gupta  in  Outlook Customer Manager  on
10 Replies
Array Formula not working in Office 365 (Mac)
K P  in  Formulas and Functions  on
2 Replies
Microsoft Whiteboard
Microsoft Ignite  in  Microsoft Ignite Content 2017  on
2 Replies