From 40f663ccb26f149a015a60e03630731245c30065 Mon Sep 17 00:00:00 2001 From: "G.Reijn" Date: Sat, 10 May 2025 08:32:54 +0200 Subject: [PATCH 1/2] Add Bicep example --- dsc/examples/file.bicep | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dsc/examples/file.bicep diff --git a/dsc/examples/file.bicep b/dsc/examples/file.bicep new file mode 100644 index 00000000..d435f353 --- /dev/null +++ b/dsc/examples/file.bicep @@ -0,0 +1,22 @@ +// 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\\' + } + } + ] + } +} From 159fe7cbeda1708c1cef78442faa7669ae55d4e3 Mon Sep 17 00:00:00 2001 From: "G.Reijn" Date: Sat, 10 May 2025 08:35:55 +0200 Subject: [PATCH 2/2] Call Bicep --- dsc/examples/file.bicep | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dsc/examples/file.bicep b/dsc/examples/file.bicep index d435f353..28e082ad 100644 --- a/dsc/examples/file.bicep +++ b/dsc/examples/file.bicep @@ -20,3 +20,5 @@ resource powerShellAdapter 'Microsoft.Windows/WindowsPowerShell@2025-01-07' = { ] } } + +// bicep build file.bicep