Domain Detective

API Reference

Class

CmdletNewDesiredState

Namespace DomainDetective.PowerShell
Assembly DomainDetective.PowerShell
Base PSCmdlet
Modifiers sealed
Attributes
Cmdlet("New", "DDDesiredState") Alias(["New-DesiredState"]) OutputType([typeof(DesiredStateConfiguration)])

Creates a desired state configuration object for use with DomainDetective.

Inheritance

  • PSCmdlet
  • CmdletNewDesiredState

Examples

Create an empty desired state configuration

PS>


$cfg = New-DDDesiredState
        

Creates an in-memory configuration object with defaults and no overrides.

Load from JSON and override values

PS>


$cfg = New-DDDesiredState -LoadPath .\desired-state.json
        

Loads a configuration from disk, allowing further in-memory changes.

Build using the DSL

PS>


$cfg = New-DDDesiredState { New-DDDesiredStateDmarc -Enabled $true -AllowedPolicies reject }
        

Builds a configuration by applying profile fragments returned from the script block.

Constructors

public CmdletNewDesiredState() #

Methods

ProcessRecord() #

Creates a configuration object, optionally loading JSON and applying DSL fragments.

Properties

public String LoadPath { get; set; } #
Parameter(Mandatory = false)
public ScriptBlock ScriptBlock { get; set; } #
Parameter(Mandatory = false, Position = 0)
{{ include "footer" }}