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
Post a Comment