powershell
powershell copied to clipboard
[BUG] Running SetSiteVersionPolicy with App Permissions throws error
Reporting an Issue or Missing Feature
When I run SetSiteVersionPolicy with App Permissions, I get an error: "Cannot call this API with an app-only principal."
The actual call is this:
Set-PnPSiteVersionPolicy -Connection $siteConnection -EnableAutoExpirationVersionTrim $true -ApplyToExistingDocumentLibraries -ApplyToNewDocumentLibraries
Expected behavior
Actual behavior
I've tested, and I believe it's a false error. The cmdlet seems to have the desired effect, in that a new Doc Lib created in the site right after running the cmdlet gets Automatic Versioning. (It can take up to 24h for it to take effect on existing libs.)
What is the version of the Cmdlet module you are running?
3.1.0
Which operating system/environment are you running PnP PowerShell on?
- [x] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify
Wondering whether you tried it with the nightly build. I can't reproduce the misleading error with PnP PowerShell module version 3.1.91.
Any luck trying the latest PnP PowerShell version?