DSC Resource with Mandatory Property

suggest change
[DscResource()]
class Ticket {
  [DscProperty(Key)]
  [string] $TicketId

  [DscProperty(Mandatory)]
  [string] $Subject
}

When building a DSC Resource, you’ll often find that not every single property should be mandatory. However, there are some core properties that you’ll want to ensure are configured by the user of the DSC Resource. You use the Mandatory parameter of the [DscResource()] attribute to declare a property as required by the DSC Resource’s user.

In the example above, we’ve added a Subject property to a Ticket resource, that represents a unique ticket in a ticketing system, and designated it as a Mandatory property.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents