Replies: 3 comments
-
Any update? I'm also having the same issue when trying to execute Set-PnPListItem |
Beta Was this translation helpful? Give feedback.
-
Have the same |
Beta Was this translation helpful? Give feedback.
-
I've found it tends to be an error with PowerShell loading the function. Generally if I shutdown PowerShell and reopen it I can get it to load by either just waiting longer or searching for it in the modules and clicking Show Details. That will force it to load and then I can use it. I'm not sure why it doesn't just load automatically with all the rest of the PNP functions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So I don't want to report this as an "Issue" unless it actually is but this used to work and on occasion it slips by and does work but more often than not for the past two days it has failed. First thing this morning I went to show a co-worker the issue and the cmdlet executed without issue in two different scripts, one was a Module Script the other a Stand-alone script. As the module script ran fine alone I then ran the Master script and when it hit the cmdlet in the Module Script it failed. So naturally I went back and attempted to run the Module Script directly again and this time it failed. I also tried to run the other Stand-alone script and it also failed the second time around. Mind you I was using the same data and site the entire time no changes, I just kept going in and clearing out the data to reset it with the script for testing.
I've attempted to simplify and change minor data rather than metadata fields or just changing the Content Type or Label but any or all Set-PNPListItem calls seem to fail and I'm not sure why or what has happened to cause it.
The actual code and some test lines I have used:
All fail with the same Error:
+Set-PnPListItem : Method not found: 'Void Microsoft.SharePoint.Client.ListItem.SetComplianceTag(System.String, Boolean, Boolean, +Boolean, Boolean, Boolean)'.
+At line:1 char:1
+ Set-PnPListItem -List "SitePages" -Identity 73 -Values $pageValues
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Set-PnPListItem], MissingMethodException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Lists.SetListItem
Like I said this code has been in place for a long time and it has just randomly stopped working. We did just recently upgrade to PNP v9 but this cmlet was tested on v1.9 and worked at the time of testing (and as early as this morning). Nothing about the code, sites, or data has changed "to my knowledge". And I'm a bit stumped about the error stating SetComplianceTag. Is this a normal thing to see with the Set-PNPListItem? Could there be a setting on our tenant causing this error?
Beta Was this translation helpful? Give feedback.
All reactions