File tree Expand file tree Collapse file tree 3 files changed +36
-7
lines changed
AtlasModules/Acknowledgements Expand file tree Collapse file tree 3 files changed +36
-7
lines changed Original file line number Diff line number Diff line change 1- # Load DefaultUser hive
2- $module = Get-Module - Name " FXPSYaml"
3- if (! $module ) {
4- Install-PackageProvider - Name NuGet - MinimumVersion 2.8 .5.201 - Force
5- Install-Module - Name FXPSYaml - Force
6- Import-Module - Name FXPSYaml
1+ # Load YamlDotNet for YAML parsing
2+ # YamlDotNet by Antoine Aubry - https://github.com/aaubry/YamlDotNet (MIT License)
3+ Add-Type - Path " $PSScriptRoot \YamlDotNet.dll"
4+
5+ function ConvertFrom-Yaml {
6+ param ([string ]$YamlString )
7+ $reader = New-Object System.IO.StringReader($YamlString )
8+ $yamlStream = New-Object YamlDotNet.RepresentationModel.YamlStream
9+ $yamlStream.Load ($reader )
10+ $reader.Close ()
11+
12+ function ConvertNode ($node ) {
13+ if ($node -is [YamlDotNet.RepresentationModel.YamlMappingNode ]) {
14+ $ht = @ {}
15+ foreach ($pair in $node.Children ) {
16+ $ht [$pair.Key.Value ] = ConvertNode $pair.Value
17+ }
18+ return $ht
19+ }
20+ elseif ($node -is [YamlDotNet.RepresentationModel.YamlSequenceNode ]) {
21+ $arr = @ ()
22+ foreach ($item in $node.Children ) {
23+ $arr += ConvertNode $item
24+ }
25+ return $arr
26+ }
27+ else {
28+ return $node.Value
29+ }
30+ }
31+
32+ return ConvertNode $yamlStream.Documents [0 ].RootNode
733}
34+
835$configurationFolder = Join-Path $PSScriptRoot " ..\Configuration\tweaks"
936$yamlFiles = Get-ChildItem - Path $configurationFolder - Filter * .yml - Recurse
1037$RegistryPaths = @ ()
@@ -39,4 +66,4 @@ foreach ($path in $RegistryPaths) {
3966 }
4067 }
4168 }
42- }
69+ }
Original file line number Diff line number Diff line change 1+ [InternetShortcut]
2+ URL =https://github.com/aaubry/YamlDotNet
You can’t perform that action at this time.
0 commit comments