Last active
September 21, 2016 18:29
-
-
Save 1RedOne/9574256d0a78e6681919d7eb2eb6e1e2 to your computer and use it in GitHub Desktop.
Figure out which values are which
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $sampleSyntax = ((Get-DscResource User -Syntax).Split("`n") -join "`n") | |
| {" | |
| UserName = [string] | |
| [DependsOn = [string[]]] | |
| [Description = [string]] | |
| [Disabled = [bool]] | |
| [Ensure = [string]{ Absent | Present }] | |
| [FullName = [string]] | |
| [Password = [PSCredential]] | |
| [PasswordChangeNotAllowed = [bool]] | |
| [PasswordChangeRequired = [bool]] | |
| [PasswordNeverExpires = [bool]] | |
| [PsDscRunAsCredential = [PSCredential]] | |
| " | ConvertFrom-StringData} | |
| $fields = $sampleSyntax.Split("`n")[2..(($sampleSyntax.Split("`n").length)-3)] | ConvertFrom-StringData | |
| foreach ($field in $fields){ | |
| $name = $field.Keys[0] | |
| if ($name -like "``[*"){$name = $name -replace '\['} | |
| if ($field.Values[0] -like "*string*"){"$name should render as a textbox for strings"} | |
| if ($field.Values[0] -like "*bool*") {"$name should render as a radio true/false"} | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment