Skip to content

Commit 7701b43

Browse files
Fix json and add regex
1 parent 48081f8 commit 7701b43

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/dsc/psresourceget.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ function GetOperation {
5050
[string]$ResourceType
5151
)
5252

53+
## TODO : ensure that version returned includes pre-release versions
54+
5355
$inputObj = $stdinput | ConvertFrom-Json -ErrorAction Stop
5456

5557
switch ($ResourceType) {
@@ -210,6 +212,16 @@ function SetOperation {
210212
[string]$ResourceType
211213
)
212214

215+
<# TODO
216+
// for test and set everything
217+
// 2 json lines
218+
// state == current state of object
219+
// diff == array of properties that are different
220+
221+
// for other operations, DONOT return _inDesiredState
222+
223+
#>
224+
213225
$inputObj = $stdinput | ConvertFrom-Json -ErrorAction Stop
214226

215227
switch ($ResourceType) {

src/dsc/psresources.dsc.resource.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@
102102
"version": {
103103
"title": "Version",
104104
"description": "The version range of the resource.",
105-
"type": "string"
106-
// Look at nuget versioning for format
107-
// returning back semantic version by adding prerelease
105+
"type": "string",
106+
"pattern": "^(\\[|\\()\\s*\\d+(\\.\\d+){0,2}(-[0-9A-Za-z-.]+)?\\s*(,\\s*(\\d+(\\.\\d+){0,2}(-[0-9A-Za-z-.]+)?)?\\s*(\\]|\\)))?$"
108107
},
109108
"scope": {
110109
"title": "Scope",
@@ -128,13 +127,6 @@
128127
"_inDesiredState": {
129128
"$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json"
130129
}
131-
132-
// for test and set everything
133-
// 2 json lines
134-
// state == current state of object
135-
// diff == array of properties that are different
136-
137-
// for other operations, DONOT return _inDesiredState
138130
}
139131
}
140132
}

0 commit comments

Comments
 (0)