Skip to content

Commit d6f044a

Browse files
committed
Add Bicep example
1 parent fa7173e commit d6f044a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

dsc/examples/file.bicep

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This example demonstrates how to create a file using the Windows PowerShell DSC extension.
2+
// The file is created in the C:\DSC directory on the target machine.
3+
// You should at least have the Bicep CLI v0.34.34 installed to run this example with experimental feature desiredStateConfiguration turned on.
4+
5+
targetScope = 'desiredStateConfiguration'
6+
7+
resource powerShellAdapter 'Microsoft.Windows/WindowsPowerShell@2025-01-07' = {
8+
name: 'Use Bicep to create file'
9+
properties: {
10+
resources: [
11+
{
12+
name: 'File'
13+
type: 'PSDesiredStateConfiguration/File'
14+
properties: {
15+
Ensure: 'Present'
16+
Type: 'Directory'
17+
DestinationPath: 'C:\\DSC\\'
18+
}
19+
}
20+
]
21+
}
22+
}

0 commit comments

Comments
 (0)