0

I'm trying to just test this out by running these two commands (after connecting) from the command prompt and I'm constantly getting a "Cannot complete this action." error message with no further details about what or why.

$caml = "<View><Query><Where><Eq><FieldRefName='HostName'/><Eq><Value Type='Text'>myservername</Value></Eq></Where></Query></View>"
$list = Get-PnPListItem -List ServerInventory_Official-List -Query $caml
4

You query is not constructed correctly try this instead:

//with your param
$caml = "<View><Query><Where><Eq><FieldRefName='HostName'/><Value Type='Text'>" + myservername + "</Value></Eq></Where></Query></View>";

//without param
$caml = "<View><Query><Where><Eq><FieldRefName='HostName'/><Value Type='Text'>myservername</Value></Eq></Where></Query></View>";

you had an extra <Eq> in there.

| improve this answer | |
  • Actually yeah I tried removing that extra Eq and it resulted in an error saying " One or more field types are not installed properly. Go to the list settings page to delete these" -OR- it gives an error saying that the value does not fall within expected range. – Nathan McKaskle Apr 9 '18 at 19:00

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.