-
Notifications
You must be signed in to change notification settings - Fork 399
Description
Reporting an Issue or Missing Feature
I am unable to add a ContentType to a List, when the site was not created in english.
(I'm not really sure whether this is really a bug "here" or some quirky language setting in SPO/M365.)
Expected behavior
The (existing) contentType was added to the (existing) list.
Actual behavior
The Commandlet aborts with an exception, the contentType is not added to the list.
Steps to reproduce behavior
$tenant = "mytenant"
$site = "test3"
connect-PnPOnline -Interactive "https://$($tenant)-admin.sharepoint.com/"
New-PnPSite -Type CommunicationSite `
-SiteDesign Blank `
-Lcid 1031 `
-Title $site `
-Url https://$($tenant).sharepoint.com/sites/$site `
-Wait | Out-Null
connect-PnPOnline -Interactive "https://$($tenant).sharepoint.com/sites/$site"
$ct = Add-PnPContentType -Name "Test" -ContentTypeId 0x010100E4E6B3CDBCEA495CB5854144F092741E
$l = Get-PnPList "Dokumente"
Add-PnPContentTypeToList -List $l -ContentType $ct
Additionally, and I'm not sure if this has always been the case:
I can not access the Library called "Documents" (fine, the site is not english..) and I can access the library "Dokumente". However:
➜ get-pnplist "Dokumente"
Title Id Url
----- -- ---
Documents 0db0a920-38dc-4c80-9b3e-a6b82c6b5b6f /sites/test3/Freigegebene Dokumente
Notice, here how (Get-PNPList "Dokumente").Title yields the result Documents.
The script fails with:
➜ Get-PnPException
Message : List 'Documents' does not exist at site with URL 'https://mytenant.sharepoint.com/sites/test3'.
Stacktrace : at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 98
at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1
What is the version of the Cmdlet module you are running?
➜ Get-Module -Name "PnP.PowerShell" -ListAvailable
Directory: C:\Users\andresen_n\Documents\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 2.1.1 PnP.PowerShell Desk {Add-PnPAdaptiveScopeProperty, Add-PnPPropertyBagValue, Add-PnPSiteCla…
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify