-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add-PnPApp throws System.UnauthorizedAccessException when custom script is blocked on app catalog #4203
Comments
Does it work releasing the spfx package through the UI on SPO or do you get an error there too ? |
This is by design, not a bug. You will need to unblock in order to upload the app. |
So the policy is not to add that check to the various commands ? |
A new optional parameter might be a good trade-off between respecting the policy by default and providing a convenient way to users to override it, as long as they have the permissions to flip the Custom scripts setting to Allowed. Would that be an acceptable solution ? |
I think the policy should be covering all the CMDs where the blocking of Custom Scripting is an issue.
I would of course prefer #3 but I have no idea about how many CMDs that we are talking about |
Fix #4203: Add -Force parameter to Add-PnPApp, Publish-PnPApp, Remove-PnPApp, and Unpublish-PnPApp to allow temporary script enabling on no-script sites
Reporting an Issue or Missing Feature
We have discovered that when the Custom Script setting is set to "Blocked" on the app catalog site, we are unable to release our SPFx web part using the
Add-PnPApp
cmdlet. We receive aSystem.UnauthorizedAccessException
.If we change the setting to "Allowed", it works fine.
Expected behavior
We expect to be able to release our SPFx web parts using the
Add-PnPApp
cmdlet without having to first runSet-PnPSite -NoScriptSite $false
Steps to reproduce behavior
Set the Custom script setting to "Blocked" on the app catalog site and run the
Add-PnPApp
cmdlet on this site.What is the version of the Cmdlet module you are running?
Running PnP.PowerShell 2.10.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: