MilestoneSystemsInc / PowerShellSamples

A collection of samples for managing your Milestone XProtect VMS using MilestonePSTools in PowerShell
https://www.milestonepstools.com
MIT License
37 stars 12 forks source link

New-VmsRole #120

Closed Jaffe1986 closed 9 months ago

Jaffe1986 commented 9 months ago

Just a heads-up, I was working on a script that creates new customers. I was running through ..

New-VmsDeviceGroup -Name $ -Description $

New-VmsViewGroup -Name $ -Description $

New-VmsRole -Name $ -Description $

I noticed I was getting 2 view groups, one with a description and one without. I ran through each line and I found that New-VmsRole also creates a ViewGroup.

I was able to account for this in the end but I noticed that the New-VmsRole documentation does not say that it is also creating a view group.

Tarterman commented 9 months ago

@Jaffe1986, the reason New-VmsRole creates a view group named after the Role is because that is what happens when you create a role in the Management Client (and what the APIs automatically do).

I'll tag @joshooaj so he can look at putting a note in the documentation so it is indicated that it does that. Thanks for the suggestion.

joshooaj commented 9 months ago

Thanks @Tarterman that's exactly what's happening! There is no code in that cmdlet to create a viewgroup - the management server does it whether you want it to or not. I'll be sure to publish a note in the docs about it soon, thanks for the head up @Jaffe1986 🙏🏼

joshooaj commented 9 months ago

Thanks again @Jaffe1986, the docs for New-VmsRole have been updated with notes about the view group "side effect".