Please run the below PowerShell script as an admin on SharePoint Online Management Shell:
#Config Variables
$SiteURL = "https://{domain}.sharepoint.com/sites/{sitename}"
$ListName= "{listname}"
$ViewName= "{Test View}"
$ViewFields = @("Title","Dimension","Format","PPL","ProceedDate")
$Query = "<Where><Eq><FieldRef Name='PPL'/><Value Type='Integer'><UserID/></Value></Eq></Where>"
#Get Credentials to connect
$Cred = Get-Credential
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#sharepoint online pnp powershell create view
Add-PnPView -List $ListName -Title $ViewName -ViewType Html -Fields $ViewFields -Query $Query -ErrorAction Stop
Write-host "View '$ViewName' Created Successfully!" -f Green
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
Here is my test:
This is my list:
Run the PowerShell script:
Create new view: