0

Right now I am looking for a way to run a PowerShell script on a "selected" list item in a sharepoint online list.

Every code snippet I see points to running code on the entire list.

1

Yes, it's normal, there is no relation between the PowerShell and the Selected Items in the list in GUI.

So in your case, you can Use Where clause based on specific criteria to run the PowerShell cmdlet on specific list items on your list.

Ex:

$listItems = $list.Items| where {$_['column name'] -eq 'True'}

Then for-each for each item in $listItems as the following

$listItems | ForEach-Object {
   #Cmdlets
}
| improve this answer | |
  • What I am trying to do it use the "copy to" menu option to do this while keeping the reference Item ID intact – scottj Dec 12 '17 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.