February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Test method is used to determine whether Set should be run. DSC invokes Test before Set. The Test method returns a Boolean value.
The Test method must perform the following tests to ascertain the state of this configuration item:
The following snippet implements these tests:
[Boolean] Test() { $key = Get-Item $this.Path if ($this.Ensure -eq 'Present') { if ($key.GetValueNames() -notcontains $this.valueName) { return $false } return $key.GetValue($this.valueName) -eq $this.Description ...Read now
Unlock full access