Skip to content

[BUG] Running SetSiteVersionPolicy with App Permissions throws error #5105

@sympmarc

Description

@sympmarc

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?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions