diff --git a/dsc/examples/file.bicep b/dsc/examples/file.bicep new file mode 100644 index 00000000..28e082ad --- /dev/null +++ b/dsc/examples/file.bicep @@ -0,0 +1,24 @@ +// This example demonstrates how to create a file using the Windows PowerShell DSC extension. +// The file is created in the C:\DSC directory on the target machine. +// You should at least have the Bicep CLI v0.34.34 installed to run this example with experimental feature desiredStateConfiguration turned on. + +targetScope = 'desiredStateConfiguration' + +resource powerShellAdapter 'Microsoft.Windows/WindowsPowerShell@2025-01-07' = { + name: 'Use Bicep to create file' + properties: { + resources: [ + { + name: 'File' + type: 'PSDesiredStateConfiguration/File' + properties: { + Ensure: 'Present' + Type: 'Directory' + DestinationPath: 'C:\\DSC\\' + } + } + ] + } +} + +// bicep build file.bicep