powershell - How to declare an array of strings (on multiple lines) -
why $dlls.count
return single element? try declare array of strings such:
$basepath = split-path $myinvocation.mycommand.path $dlls = @( $basepath + "\bin\debug\dll1.dll", $basepath + "\bin\debug\dll2.dll", $basepath + "\bin\debug\dll3.dll" )
you should use like:
$dlls = @( ($basepath + "\bin\debug\dll1.dll"), ($basepath + "\bin\debug\dll2.dll"), ($basepath + "\bin\debug\dll3.dll") ) or $dlls = @( $($basepath + "\bin\debug\dll1.dll"), $($basepath + "\bin\debug\dll2.dll"), $($basepath + "\bin\debug\dll3.dll") )
as answer shows, semicolons work because marks end of statement...that evaluated, similar using parenthesis.
alternatively, use pattern like:
$dlls = @() $dlls += "...."
but might want use arraylist , gain performance benefits...
Comments
Post a Comment