Replies: 3 comments 1 reply
-
Have you found a solution or workaround for this? I am getting the same error message with a different cmdlt 'Get-PnPListItem' with PnP 2.4.0. It also works fine when executed interactively at ps prompt (terminal), but not when running as part of a script. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem with different commands (Set-PnPList). For me it looks like a bug somewhere else. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. When adding a content type to a newly created "Generic List" the following script does not work when run as part of an entire script, but the line "Add-PnPContentTypeToList" will work when run individually. However, creating a "Document Library" works when run as an entire script.
|
Beta Was this translation helpful? Give feedback.
-
Reporting an Issue or Missing Feature
When running Set-PnPList -BreakRoleInheritance -ResetRoleInheritance, the command fails and returns this exception message "The list is not DocumentLibrary, VersionPolicies is not supported." A user with a very similar issue reported this today on Stack Overflow here
Expected behavior
The command should result in the list having its inheritance permissions broken from the parent site AND having all existing permissions removed.
Actual behavior
When running the script either from VS Code or pwsh.exe, the exception is thrown. However, if I stop the debugger and run the script manually (by running the selection), it runs successfully.

Steps to reproduce behavior
$list = "Test List"
Set-PnPList -Identity $list -BreakRoleInheritance -ResetRoleInheritance
Code fails during script runs, but will complete if run as an individual selection.
What is the version of the Cmdlet module you are running?
PnP.PowerShell 2.2.130 nightly build
Which operating system/environment are you running PnP PowerShell on?
Beta Was this translation helpful? Give feedback.
All reactions