-
Notifications
You must be signed in to change notification settings - Fork 36
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
Invoke-PnPSiteTemplate -Path $FilePath -ErrorAction Stop -WarningAction SilentlyContinue - Error Message: Attempted to perform an unauthorized operation. #224
Comments
Hi @BrandtC-NAIT, Thanks for reaching out to us. Please ensure that you are executing these scripts on PowerShell 7.2 or later, as it is a prerequisite for using PnP PowerShell. Additionally, update PnP PowerShell and attempt to run the scripts again. https://pnp.github.io/powershell/articles/installation.html Please let us know if this worked. Thanks. |
Same issue under PowerShell 7.4.1 and Updated PnP Module
|
Hi @BrandtC-NAIT, Can you please try creating a different site name without under scores |
Tried that, no spaces, only Mixed Caps: FacilitiesEmergencyManagement |
Hi @BrandtC-NAIT, Can you please check if the SP site is created and if any lists are created. |
As reported by the SharePoint Team: https://imgur.com/a/SebYcA8](url) |
Hi @BrandtC-NAIT, Can you please share a screenshot directly here instead of the link. Thanks. |
Shared as requested. @v-saikirang |
Hi @BrandtC-NAIT, Thanks for sharing the screenshots. Please make sure you are added as site collection admin to the share point site and try to tweak the script to run only the lists creation. Update the URL variable with full site URL since the site is already created. Connect-PnPOnline -Url $TenantURL$EOCSiteURL -Interactive
|
Hardcoding in the path with the below changes did the trick:
NOTE: any ---VALUE PLACEHOLDER--- is me removing the content for security reasons in this post. |
Hi @BrandtC-NAIT, So as i understand the issue is cleared now. Please confirm if i can close the ticket. |
@v-saikirang please do close the ticket. Issue is now resolved. |
I debug ran the script and here is what happened:
It fails on this line of code, line #66:
Invoke-PnPSiteTemplate -Path $FilePath -ErrorAction Stop -WarningAction SilentlyContinue
I've moved the File around to different locations to make sure the file is accessible. Tried running the script an non & privileged PowerShell.
NOTE: any ---VALUE PLACEHOLDER--- is me removing the content for security reasons in this post.
The text was updated successfully, but these errors were encountered: