--- step
initialize
--- hostctl
{"host": "local:?timeout=120", "password": false, "script": "$ErrorActionPreference = 'Stop'/n$p = ConvertFrom-Json '{/"ScopeId/": /"10.0.0.0/", /"IPAddress/": /"10.0.0.10/", /"ClientId/": /"aa-bb-cc-dd-ee-ff/", /"Name/": /"web01/", /"ComputerName/": /"dhcp01/", /"Options/": [{/"Id/": 3, /"Value/": [/"10.0.0.1/"]}, {/"Id/": 6, /"Value/": [/"10.0.0.53/", /"10.0.0.54/"]}, {/"Id/": 15, /"Value/": [/"example.com/"]}, {/"Id/": 1, /"Value/": [/"255.255.255.0/"]}, {/"Id/": 28, /"Value/": [/"10.0.0.255/"]}, {/"Id/": 67, /"Value/": [/"undionly.kpxe/"]}]}'/n$common = @{}/nif ($p.ComputerName) { $common['ComputerName'] = $p.ComputerName }/n$existing = Get-DhcpServerv4Reservation -ScopeId $p.ScopeId @common -ErrorAction SilentlyContinue | Where-Object { $_.ClientId -eq $p.ClientId }/nif ($existing) {/n  Remove-DhcpServerv4Reservation -ScopeId $p.ScopeId -ClientId $p.ClientId @common/n}/nAdd-DhcpServerv4Reservation -ScopeId $p.ScopeId -IPAddress $p.IPAddress -ClientId $p.ClientId -Name $p.Name @common/nforeach ($o in $p.Options) {/n  Set-DhcpServerv4OptionValue -ReservedIP $p.IPAddress -OptionId $o.Id -Value $o.Value @common/n}/nConvertTo-Json @{ ok = $true }/n"}
--- step
complete
--- hostctl
{"host": "local:?timeout=120", "password": false, "script": "$ErrorActionPreference = 'Stop'/n$p = ConvertFrom-Json '{/"ScopeId/": /"10.0.0.0/", /"ClientId/": /"aa-bb-cc-dd-ee-ff/", /"ComputerName/": /"dhcp01/"}'/n$common = @{}/nif ($p.ComputerName) { $common['ComputerName'] = $p.ComputerName }/n$existing = Get-DhcpServerv4Reservation -ScopeId $p.ScopeId @common -ErrorAction SilentlyContinue | Where-Object { $_.ClientId -eq $p.ClientId }/nif ($existing) {/n  Remove-DhcpServerv4Reservation -ScopeId $p.ScopeId -ClientId $p.ClientId @common/n}/nConvertTo-Json @{ ok = $true }/n"}
