Skip to content
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 - Import Directory failed on MacOS #991

Open
salascz opened this issue Mar 7, 2024 · 1 comment
Open

Invoke-PnPSiteTemplate - Import Directory failed on MacOS #991

salascz opened this issue Mar 7, 2024 · 1 comment

Comments

@salascz
Copy link

salascz commented Mar 7, 2024

Hello,
there seems to be an issue with importing the whole directory on non Windows system.

I am using following declaration in my template.xml file:

<pnp:Files>
  <pnp:Directory Src="files" Folder="SiteAssets/Data" Overwrite="true" Level="Published" />
</pnp:Files>

The operation failed with error:
An error occurred: Value cannot be null. (Parameter 'clientObject')

Trace Log:

[PnP.Framework]	[0]	[Error]	ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerException: The file or folder name "SiteAssets/Data/files\test-file.html" contains invalid characters. Please use a different name. Common invalid characters include the following: # % * : < > ? /  |
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServerAsync(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryAsync()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQueryAsync()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQueryAsync()
   at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, String userAgent)

Please note, there seems to be backslash symbol used in file path...

Expected behavior

I should be able to import the directory from MacOS similar to Windows

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

PnP.PowerShell version 2.3.0

@maxali
Copy link

maxali commented May 14, 2024

Facing the same issue.
PnP.PowerShell version 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants