Skip to content

Commit 711e0b7

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
add example for winps multiline script
1 parent 5b974ea commit 711e0b7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

dsc/examples/winps_script.dsc.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
2+
metadata:
3+
Microsoft.DSC:
4+
securityContext: Elevated
5+
resources:
6+
- type: Microsoft.Windows/WindowsPowerShell
7+
name: Run WinPS script
8+
properties:
9+
resources:
10+
- name: Run script
11+
type: PSDesiredStateConfiguration/Script
12+
properties:
13+
GetScript: |
14+
$text = @"
15+
get
16+
"@
17+
# Returning result must be this type of hashtable
18+
@{Result=$text}
19+
TestScript: |
20+
# TestScript must return a boolean
21+
$true
22+
SetScript: |
23+
$text = @"
24+
set
25+
"@

0 commit comments

Comments
 (0)