pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Get or Apply-PnPProvisioningTemplate : The given path's format is not supported. #1660

Open PedroMordeP opened 6 years ago

PedroMordeP commented 6 years ago

Not sure if is a bug or my issue. I'm trying to apply a template to a SharePoint 2013 test site, i have the same code for SharePoint Online and is working fine.

Is something about the url, like this http://sps2013:85 ? I already installed sandboxed solutions without any issue using the PnP cmdlets.

Actual behavior

Gives an error

Apply-PnPProvisioningTemplate : The given path's format is not supported.

Steps to reproduce behavior

$siteUrl = "http://sps2013:85/sites/testsite"
$templateFullPath = "c:\mytests\mytemplate.xml"
Connect-PnPOnline -Url $siteUrl
$web = Get-PnPWeb -Includes @("WebTemplate", "CurrentUser", "Configuration")
Apply-PnPProvisioningTemplate -Web $web -Path $templateFullPath -ProvisionContentTypesToSubWebs

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

ModuleVersion = '2.28.1807.0'

How did you install the PnP-PowerShell Cmdlets?

joaoferreira commented 5 years ago

Any update on this issue, still happening with the latest version.

VesaJuvonen commented 5 years ago

Please execute Get-PnPException immediately after the exception has happened. That will show you additional details on the issue... more specifically the call stack so that you can investigate the root cause. Also - simply reducing the template size by removing sections, will eventually give you the exact definition which is causing the issue as without having access on the actual xml file - we can only speculate what exactly goes wrong.

kylepdx commented 5 years ago

I'm getting the same error. this is executing in an Azure Runbook loading the provisioning template from local file storage ($ENV:Temp). Here is the stack trace from Get-PnPException:

Message : The given path's format is not supported. Stacktrace : at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at OfficeDevPnP.Core.Framework.Provisioning.Connectors.FileSystemConnector.GetFileFromStorage(String fileName, String container) at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.Utilities.ConnectorFileHelper.GetFileBytes(FileConnectorBase connector, String fileName) at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectWebSettings.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo, Boolean calledFromHierarchy, TokenParser tokenParser) at SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate.ExecuteCmdlet() at SharePointPnP.PowerShell.Commands.PnPCmdlet.ProcessRecord() ScriptLineNumber : 5

PnP Version is 3.10.1906.0

kylepdx commented 5 years ago

Found the problem in my case: had to remove the SiteLogo attribute from the Pnp:WebSettings. I was applying this template to a Groupified site. Would be helpful if the provisioning error was a little more specific.