win_dsc: improved parameter handling (#31556)

* win_dsc: improved parameter handling

* removed uneeded try/catch leftover from testing

* removed undeed return values

* added custom DSC to fully test out casting

* fix up codestyle issues

* using new Requires ps version check

* fixed up error message check on earlier ps version
This commit is contained in:
Jordan Borean 2017-11-06 09:44:04 +10:00 committed by GitHub
commit 978a979566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1127 additions and 313 deletions

View file

@ -0,0 +1,44 @@
xTestResource Version: 2.0.0
Ensure:
Type: System.String
Value: Present
StringParam:
Type: System.String
Value: string param
UInt32Param:
Type: System.UInt32
Value: 1000
UInt64Param:
Type: System.UInt64
Value: 1000000
StringArrayParam:
Type: System.String[]
Value: [ "string 1", "string 2" ]
UInt32ArrayParam:
Type: System.UInt32[]
Value: [ 1000, 2000 ]
UInt64ArrayParam:
Type: System.UInt64[]
Value: [ 1000000, 2000000 ]
BooleanParam:
Type: System.Boolean
Value: True
PSCredentialParam:
Type: System.Management.Automation.PSCredential
Username: username
Password: password
CimInstanceParam:
Type: Microsoft.Management.Infrastructure.CimInstance
CimInstanceArrayParam:
Type: Microsoft.Management.Infrastructure.CimInstance[]

View file

@ -0,0 +1,44 @@
xTestResource Version: 1.0.0
Ensure:
Type: System.String
Value: Present
StringParam:
Type: System.String
Value: string param
UInt32Param:
Type: System.UInt32
Value: 1000
UInt64Param:
Type: System.UInt64
Value: 1000000
StringArrayParam:
Type: System.String[]
Value: [ "string 1", "string 2" ]
UInt32ArrayParam:
Type: System.UInt32[]
Value: [ 1000, 2000 ]
UInt64ArrayParam:
Type: System.UInt64[]
Value: [ 1000000, 2000000 ]
BooleanParam:
Type: System.Boolean
Value: True
PSCredentialParam:
Type: System.Management.Automation.PSCredential
Username: username
Password: password
CimInstanceParam:
Type: Microsoft.Management.Infrastructure.CimInstance
CimInstanceArrayParam:
Type: Microsoft.Management.Infrastructure.CimInstance[]