Hi @James Shidell ,
Please refer to the following code. $L1Folder
in Query is a variable, so we need to splicing two string instead of put them together.
$viewTitle = $L1Folder
$viewFields = New-Object System.Collections.Specialized.StringCollection
$viewFields.Add("DocIcon") > $null
$viewFields.Add("LinkFilename") > $null
$viewFields.Add("Modified") > $null
$viewFields.Add("Title & Description") > $null
$viewFields.Add("Disposition Instructions") > $null
$viewFields.Add("Document Type") > $null
$viewQuery = '<OrderBy><FieldRef Name="LinkFileName" /></OrderBy>
<Where><Contains><FieldRef Name="File_x0020_Series"/><Value Type="Choice">' + $L1Folder + '</Value></Contains></Where>'
$viewInfo = New-Object Microsoft.SharePoint.Client.ViewCreationInformation
$viewInfo.Query = $viewQuery
$viewInfo.RowLimit = 50
$viewInfo.Paged = $true
$viewInfo.SetAsDefaultView = $false
$viewInfo.ViewFields = $viewFields
$viewInfo.Title = $L1Folder
$newView = $docLibList.Views.Add($viewInfo)
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.