Connect-PnPOnline "https://tenant.sharepoint.com/sites/meineseite" -Interactive
$template=@"
[
{
"templateId": "NewFolder",
"title": "Folder",
"visible": false
},
{
"templateId": "NewDOC",
"title": "Word document",
"visible": false
},
{
"templateId": "NewXSL",
"title": "Excel workbook",
"visible": false
},
{
"templateId": "NewPPT",
"title": "PowerPoint presentation",
"visible": false
},
{
"templateId": "NewONE",
"title": "OneNote notebook",
"visible": false
},
{
"templateId": "NewXSLSurvey",
"title": "Excel survey",
"visible": false
},
{
"templateId": "NewXSLForm",
"title": "Forms for Excel",
"visible": false
},
{
"templateId": "NewVSDX",
"title": "Visio drawing",
"visible": false
},
{
"contentTypeId": "0x0101007083E649E686654AA7A5D0994977BD3E",
"isUpload": true,
"templateId": "MyDocumentTemplate",
"title": "my Document Template",
"url": "/sites/meineseite/AnyDocumentLibrary/MyTemplateFile.docx",
"visible": true
}
]
"@
$view = Get-PnpView -List $listname | Where-Object {$_.DefaultView -eq $true}
$view.NewDocumentTemplates = $template -replace "`n","" -replace "`r",""
$view.Update()
Invoke-PnPQuery