0

I have 2 main questions here :

  • I want to use a query with the cmdlet Get-PnPlistItem should I use -Query or | Where-Object to do it?
  • What is wrong with this line? it returns me a null array when it shouldn't : $listItem = Get-PnPListItem -List "Templates" | Where-Object { $_.FieldValues["ID"] -eq 1 } The item with 1 as ID exists in my list
Ricola
  • 51
  • 4

1 Answers1

0
 $listItem = Get-PnPListItem -List "Templates" | Where-Object { $_.FieldValues.ID -eq 1 }
toyota Supra
  • 3,181
  • 4
  • 15
  • 19
Angel Stephen
  • 11
  • 2
  • 5
  • 1
    Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. **Would you kindly [edit] your answer to include additional details for the benefit of the community?** – Jeremy Caney Aug 25 '23 at 02:36