powershell - Passing string variable to Sharepoint command without desired outcome -


i have number of fields using build string extraction of values sharepoint 2013 list.

i use build string.

foreach($column in $stringcolumns){ $fields=$fields+"`""+$column+"`"" if($loop -ne $columncount){ $fields=$fields+"," $loop++} } 

i take built $fields [string] variable , pass command.

$splist.getitems($queryfromsource)[$itemnumber][$fields] 

the result receive no output command. makes odd can confirm $fields has appropriate string in command. have done calling in console , copying output sharepoint command directly. when that, receive output looking for.

this seems should incredibly simple driving me insane.

would work?

foreach ($column in $stringcolumns) {     $fields+= "`"$($column)`""     if ($loop -ne $columncount)     {         $fields+= ","         $loop++         # use write-host debugging         write-host "column $loop of $columncount"      } } 

do initialize $loop somewhere, might try having print loop number you're on?


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -