Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reference/schemas/config/functions/add.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'add' DSC configuration document function
ms.date: 02/28/2025
ms.date: 09/01/2026
ms.topic: reference
title: add
---
Expand Down Expand Up @@ -39,7 +39,7 @@ resources:
```

```bash
dsc config get --file add.example.1.dsc.config.yaml
dsc config get --file add.example.1.dsc.config.yaml
```

```yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/schemas/config/functions/array.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'array' DSC configuration document function
ms.date: 08/12/2025
ms.date: 09/01/2026
ms.topic: reference
title: array
---
Expand Down Expand Up @@ -153,7 +153,7 @@ The single value to wrap in the array.

```yaml
Type: string, number, array, or object
Required: false
Required: true
MinimumCount: 1
MaximumCount: 1
```
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/schemas/config/functions/base64ToString.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'base64ToString' DSC configuration document function
ms.date: 09/30/2025
ms.date: 09/01/2026
ms.topic: reference
title: base64ToString
---
Expand Down Expand Up @@ -70,7 +70,7 @@ resources:
```

```bash
dsc config get --file base64ToString.example.2.dsc.config.yaml
dsc config get --file base64ToString.example.2.dsc.config.yaml
```

```yaml
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/schemas/config/functions/bool.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'bool' DSC configuration document function
ms.date: 01/19/2025
ms.date: 09/01/2026
ms.topic: reference
title: bool
---
Expand Down Expand Up @@ -112,10 +112,12 @@ hadErrors: false
The `bool()` function requires a single argument that is either a string or number.

For strings, valid values are:

- "true" (case-insensitive) - converts to `true`
- "false" (case-insensitive) - converts to `false`

For numbers:

- 0 - converts to `false`
- Any non-zero value - converts to `true`

Expand Down
20 changes: 13 additions & 7 deletions docs/reference/schemas/config/functions/cidrHost.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'cidrHost' DSC configuration document function
ms.date: 11/03/2025
ms.date: 09/01/2026
ms.topic: reference
title: cidrHost
---
Expand Down Expand Up @@ -83,9 +83,15 @@ resources:
properties:
output:
subnet: "[cidrSubnet(parameters('baseNetwork'), 24, parameters('subnetIndex'))]"
webServer1: "[cidrHost(cidrSubnet(parameters('baseNetwork'), 24, parameters('subnetIndex')), 10)]"
webServer2: "[cidrHost(cidrSubnet(parameters('baseNetwork'), 24, parameters('subnetIndex')), 11)]"
webServer3: "[cidrHost(cidrSubnet(parameters('baseNetwork'), 24, parameters('subnetIndex')), 12)]"
webServer1: >-
[cidrHost(cidrSubnet(parameters('baseNetwork'), 24,
parameters('subnetIndex')), 10)]
webServer2: >-
[cidrHost(cidrSubnet(parameters('baseNetwork'), 24,
parameters('subnetIndex')), 11)]
webServer3: >-
[cidrHost(cidrSubnet(parameters('baseNetwork'), 24,
parameters('subnetIndex')), 12)]
```

```bash
Expand All @@ -100,9 +106,9 @@ results:
actualState:
output:
subnet: 172.16.10.0/24
webServer1: 172.16.10.10
webServer2: 172.16.10.11
webServer3: 172.16.10.12
webServer1: 172.16.10.11
webServer2: 172.16.10.12
webServer3: 172.16.10.13
messages: []
hadErrors: false
```
Expand Down
30 changes: 20 additions & 10 deletions docs/reference/schemas/config/functions/cidrSubnet.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'cidrSubnet' DSC configuration document function
ms.date: 11/03/2025
ms.date: 09/01/2026
ms.topic: reference
title: cidrSubnet
---
Expand Down Expand Up @@ -96,7 +96,8 @@ resources:
westus: "[cidrSubnet(parameters('baseNetwork'), parameters('newPrefix'), 1)]"
northeurope: "[cidrSubnet(parameters('baseNetwork'), parameters('newPrefix'), 2)]"
westeurope: "[cidrSubnet(parameters('baseNetwork'), parameters('newPrefix'), 3)]"
southeastasia: "[cidrSubnet(parameters('baseNetwork'), parameters('newPrefix'), 4)]"
southeastasia: >-
[cidrSubnet(parameters('baseNetwork'), parameters('newPrefix'), 4)]
```

```bash
Expand Down Expand Up @@ -142,9 +143,15 @@ resources:
output:
vnetAddressSpace: "[parameters('vnetCidr')]"
subnetCidr: "[cidrSubnet(parameters('vnetCidr'), 24, parameters('subnetIndex'))]"
subnetDetails: "[parseCidr(cidrSubnet(parameters('vnetCidr'), 24, parameters('subnetIndex')))]"
gatewayIP: "[cidrHost(cidrSubnet(parameters('vnetCidr'), 24, parameters('subnetIndex')), 1)]"
loadBalancerIP: "[cidrHost(cidrSubnet(parameters('vnetCidr'), 24, parameters('subnetIndex')), 4)]"
subnetDetails: >-
[parseCidr(cidrSubnet(parameters('vnetCidr'), 24,
parameters('subnetIndex')))]
gatewayIP: >-
[cidrHost(cidrSubnet(parameters('vnetCidr'), 24,
parameters('subnetIndex')), 1)]
loadBalancerIP: >-
[cidrHost(cidrSubnet(parameters('vnetCidr'), 24,
parameters('subnetIndex')), 4)]
```

```bash
Expand All @@ -167,8 +174,8 @@ results:
firstUsable: 172.16.42.1
lastUsable: 172.16.42.254
cidr: 24
gatewayIP: 172.16.42.1
loadBalancerIP: 172.16.42.4
gatewayIP: 172.16.42.2
loadBalancerIP: 172.16.42.5
messages: []
hadErrors: false
```
Expand All @@ -194,9 +201,12 @@ resources:
properties:
output:
baseNetwork: "[parameters('ipv6BaseNetwork')]"
subnet0: "[cidrSubnet(parameters('ipv6BaseNetwork'), parameters('subnetPrefix'), 0)]"
subnet1: "[cidrSubnet(parameters('ipv6BaseNetwork'), parameters('subnetPrefix'), 1)]"
subnet10: "[cidrSubnet(parameters('ipv6BaseNetwork'), parameters('subnetPrefix'), 10)]"
subnet0: >-
[cidrSubnet(parameters('ipv6BaseNetwork'), parameters('subnetPrefix'), 0)]
subnet1: >-
[cidrSubnet(parameters('ipv6BaseNetwork'), parameters('subnetPrefix'), 1)]
subnet10: >-
[cidrSubnet(parameters('ipv6BaseNetwork'), parameters('subnetPrefix'), 10)]
```

```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/schemas/config/functions/coalesce.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'coalesce' DSC configuration document function
ms.date: 07/24/2025
ms.date: 09/01/2026
ms.topic: reference
title: coalesce
---
Expand Down Expand Up @@ -38,7 +38,7 @@ resources:
- name: Coalesce strings
type: Microsoft.DSC.Debug/Echo
properties:
output:
output:
firstNonNull: "[coalesce(null(), 'DSC', 'landscape')]"
allNull: "[coalesce(null(), null(), null())]"
noneNull: "[coalesce('first', 'second', 'third')]"
Expand Down
5 changes: 3 additions & 2 deletions docs/reference/schemas/config/functions/concat.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'concat' DSC configuration document function
ms.date: 02/28/2025
ms.date: 09/01/2026
ms.topic: reference
title: concat
---
Expand Down Expand Up @@ -60,7 +60,8 @@ hadErrors: false

### Example 2 - Concatenate arrays of strings

The configuration uses the `concat()` function to return a combined array of strings from two arrays of strings. It uses YAML's folded multiline syntax to make the function more readable.
The configuration uses the `concat()` function to return a combined array of strings from two
arrays of strings. It uses YAML's folded multiline syntax to make the function more readable.

```yaml
# concat.example.2.dsc.config.yaml
Expand Down
31 changes: 18 additions & 13 deletions docs/reference/schemas/config/functions/contains.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'contains' DSC configuration document function
ms.date: 08/08/2025
ms.date: 09/01/2026
ms.topic: reference
title: contains
---
Expand All @@ -23,11 +23,14 @@ contains(<collection>, <value>)
The `contains()` function checks whether a collection (array, object, or
string) contains a specific value, returning `true` if it does and `false`
otherwise. For arrays, it checks if the value exists as an element. For
objects, it checks if the value exists as a property key or value. For
strings, it checks if the value exists as a substring.
objects, it checks if the value exists as a property key. The function
doesn't check object property values. For strings, it checks if the value
exists as a substring.

The function accepts string and number values for the search parameter when
used with arrays, objects, or strings.
used with arrays, objects, or strings. When the search value is a number and
the collection is an object or a string, DSC compares the number by its
string representation.

## Examples

Expand Down Expand Up @@ -76,10 +79,12 @@ messages: []
hadErrors: false
```

### Example 2 - Check object for keys and values
### Example 2 - Check object for keys

The following example shows how to check if an object contains specific keys
or values.
The following example shows how to check if an object contains specific keys.
For objects, `contains()` only checks keys, not property values. To check the
contents of a property value, access the property and check it as a string,
like the `cityHasSeattle` output in this example.

```yaml
# contains.example.2.dsc.config.yaml
Expand All @@ -96,10 +101,10 @@ resources:
type: Microsoft.DSC.Debug/Echo
properties:
output:
hasNameKey: "[contains(parameters('myObject'), 'name')]"
hasEmailKey: "[contains(parameters('myObject'), 'email')]"
hasSeattleValue: "[contains(parameters('myObject').city, 'Seattle')]"
hasAge30Value: "[contains(parameters('myObject').age, 30)]"
hasNameKey: "[contains(parameters('myObject'), 'name')]"
hasEmailKey: "[contains(parameters('myObject'), 'email')]"
hasAgeKey: "[contains(parameters('myObject'), 'age')]"
cityHasSeattle: "[contains(parameters('myObject').city, 'Seattle')]"
```

```bash
Expand All @@ -115,8 +120,8 @@ results:
output:
hasNameKey: true
hasEmailKey: false
hasSeattleValue: true
hasAge30Value: true
hasAgeKey: true
cityHasSeattle: true
messages: []
hadErrors: false
```
Expand Down
51 changes: 34 additions & 17 deletions docs/reference/schemas/config/functions/copy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Reference for the 'copy' DSC configuration document resource loop
ms.date: 02/28/2025
ms.date: 09/01/2026
ms.topic: reference
title: copy
---
Expand All @@ -23,8 +23,16 @@ copy:

The `copy` property enables you to create multiple instances of a resource in a
DSC configuration. This is the equivalent implementation of the copy
functionality from Azure Resource Manager (ARM) templates, but without support
for variables and properties, which will be added in future releases.
functionality from Azure Resource Manager (ARM) templates. DSC only supports
copy loops on resource instances. Copy loops for variables and resource
properties aren't supported. A configuration output can define `copy`, but DSC
ignores that output and emits a warning that copy loops for outputs aren't
supported.

> [!IMPORTANT]
> Copy loops are deprecated. When DSC expands a copy loop, it emits a warning
> that the copy loop is deprecated and will be removed in a future release. For
> more information, see [issue #1429][03] in the DSC repository.

When you use `copy` on a resource, DSC creates multiple instances of that
resource based on the specified count. You can use the [`copyIndex()`][01]
Expand Down Expand Up @@ -186,27 +194,32 @@ resources:
```

```bash
dsc config get --file copy.example.4.dsc.config.yaml --parameters '{"instanceCount": 4}'
params='{"parameters": {"instanceCount": 4}}'
dsc config --parameters "$params" get --file copy.example.4.dsc.config.yaml
```

```yaml
results:
- metadata:
Microsoft.DSC:
duration: PT0.2173106S
name: Dynamic-0
- name: Dynamic-0
type: Microsoft.DSC.Debug/Echo
result:
actualState:
output: Instance 0 of 4
- name: Dynamic-1
type: Microsoft.DSC.Debug/Echo
result:
actualState:
output: Instance 1 of 4
- name: Dynamic-2
type: Microsoft.DSC.Debug/Echo
result:
actualState:
output: Instance 0 of 2
- metadata:
Microsoft.DSC:
duration: PT0.0161486S
name: Dynamic-1
output: Instance 2 of 4
- name: Dynamic-3
type: Microsoft.DSC.Debug/Echo
result:
actualState:
output: Instance 1 of 2
output: Instance 3 of 4
messages: []
hadErrors: false
```
Expand Down Expand Up @@ -261,17 +274,21 @@ resources to create in each batch when using parallel mode.

The current implementation has the following limitations:

- **Variables and properties**: Copy loops for variables and properties are not
yet supported.
- **Deprecation**: Copy loops are deprecated. DSC emits a warning when it
expands a copy loop. For more information, see [issue #1429][03].
- **Resources only**: Copy loops are only supported on resource instances. Copy
loops for variables and resource properties aren't supported. DSC ignores a
`copy` definition on a configuration output and emits a warning.
- **Mode control**: The `mode` property (serial/parallel) is not implemented.
- **Batch processing**: The `batchSize` property is not implemented.
- **Name expressions**: The resource name expression must evaluate to a string.

## Related Functions
## Related functions

- [`copyIndex()`][01] - Returns the current iteration index of a copy loop.
- [`parameters()`][02] - Returns the value of a configuration parameter.

<!-- Link reference definitions -->
[01]: ./copyIndex.md
[02]: ./parameters.md
[03]: https://github.com/PowerShell/DSC/issues/1429
Loading
Loading