Skip to content

Commit cc08525

Browse files
committed
Fix formatting
1 parent e80081f commit cc08525

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/reference/schemas/config/functions/copyIndex.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ resources:
5050
properties:
5151
output: "Hello DSC"
5252
```
53+
5354
```bash
5455
dsc config get --file copyIndex.example.1.dsc.config.yaml
5556
```
@@ -74,9 +75,12 @@ results:
7475
messages: []
7576
hadErrors: false
7677
```
78+
7779
### Example 2 - Using copyIndex with offset
80+
7881
This example demonstrates using an offset to start numbering from a different
7982
value.
83+
8084
```yaml
8185
# copyIndex.example.2.dsc.config.yaml
8286
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
@@ -89,6 +93,7 @@ resources:
8993
properties:
9094
output: "Server instance starting from 10 till 12"
9195
```
96+
9297
```bash
9398
dsc config get --file copyIndex.example.2.dsc.config.yaml
9499
```
@@ -113,8 +118,11 @@ results:
113118
messages: []
114119
hadErrors: false
115120
```
121+
116122
### Example 3 - Using copyIndex with loop name
123+
117124
This example shows how to reference a specific loop by name.
125+
118126
```yaml
119127
# copyIndex.example.3.dsc.config.yaml
120128
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
@@ -127,6 +135,7 @@ resources:
127135
properties:
128136
output: "Item from loop"
129137
```
138+
130139
```bash
131140
dsc config get --file copyIndex.example.3.dsc.config.yaml
132141
```
@@ -141,8 +150,11 @@ results:
141150
messages: []
142151
hadErrors: false
143152
```
153+
144154
### Example 4 - Using copyIndex with loop name and offset
155+
145156
This example combines both loop name and offset parameters.
157+
146158
```yaml
147159
# copyIndex.example.4.dsc.config.yaml
148160
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
@@ -155,6 +167,7 @@ resources:
155167
properties:
156168
output: "Database instance"
157169
```
170+
158171
```bash
159172
dsc config get --file copyIndex.example.4.dsc.config.yaml
160173
```
@@ -174,23 +187,32 @@ results:
174187
messages: []
175188
hadErrors: false
176189
```
190+
177191
## Parameters
192+
178193
### offset
194+
179195
An optional integer offset to add to the current index. The offset must be a
180196
non-negative number.
197+
181198
```yaml
182199
Type: integer
183200
Required: false
184201
Minimum: 0
185202
```
203+
186204
### loopName
205+
187206
An optional string specifying the name of the copy loop to reference. This is
188207
useful when you have multiple copy loops and need to reference a specific one.
208+
189209
```yaml
190210
Type: string
191211
Required: false
192212
```
213+
193214
## Output
215+
194216
The `copyIndex()` function returns an integer representing the current iteration
195217
index, optionally adjusted by the offset.
196218

@@ -215,4 +237,4 @@ The `copyIndex()` function will return an error in the following situations:
215237
- [`copy`][01] - Defines a loop to create multiple instances of a resource.
216238

217239
<!-- Link reference definitions -->
218-
[01]: ./copy.md
240+
[01]: ./copy.md

0 commit comments

Comments
 (0)