powershell - Using [array] in a class based DSC resource -


i have been creating few class based custom dsc resources , running following issue:

whenever try use array input resource, error.

for example

dscproperty(mandatory)] [array]$products 

would result in following error when try create mof file using resource:

write-nodemoffile : invalid mof definition node 'nodename':
exceptioncalling "validateinstancetext" "1" argument(s):
"convert property 'products' value type 'string[]' type 'instance' failed.

the input object $products (for example):

$products = @("windows server 2012", "windows sql server", "windows 8.1") 

i have no idea why write-nodemoffile function try convert array (it should not need converting, right?) , if needed converted - why convert array string[] instance?

anyone has clue why happens? way got work creating long string array of strings , seperating them within resource.

declare array :

[string[]]$product="ddd","dq","dqq" 

Comments

Popular posts from this blog

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -

php - Autoloader issue not returning Class -