I am trying to use PnP with CAML Query to retrieve all items in a document library where certain fields meet certain values. The query filter is working fine, it retrieves the correct documents, however I can't seem to get the ViewFields working. All it ever shows me no matter what is the Id, Title, GUID.
$listItems = Get-PnPListItem -List Documents -Query "<view><query>
<ViewFields>
<FieldRef Name='MyChoice' />
<FieldRef Name='FileRef' />
<FieldRef Name='FileLeafRef' />
</ViewFields>
<QueryOptions>
<ViewAttributes Scope='RecursiveAll' />
<Lists ServerTemplate='101' />
</QueryOptions>
<Where>
<And>
<Eq>
<FieldRef Name='MyChoice' />
<Value Type='MultiChoice'>Text Two</Value>
</Eq>
<Eq>
<FieldRef Name='MySecurity' />
<Value Type='MultiChoice'>Internal</Value>
</Eq>
</And>
</Where>
</Query>
</View>"
What am I doing wrong??