hi RamseyDwayne-9426,
We can use the script below to get the web part working:-
$wp = $webpartmanager.WebParts | Where { $_.Title -eq "Site Assets"}
To change the List View web part view:-
configuration parameters
$WebURL="http :// sp2013"
Get objects
$web = Get-SPWeb $WebURL
$list = $web.Lists["Site Assets"]
$view = $list.Views["Test"]
$page = $web.GetFile("SiteAssets/Forms/AllItems.aspx")
$page.CheckOut()
$WebPartManager = $web.GetLimitedWebPartManager($Page.ServerRelativeUrl,[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
Get the Web part
$wp = $WebPartManager.WebParts | Where { $_.Title -eq "Site Assets"}
Update Webpart Property
[xml]$x = $wp.XmlDefinition
$wp.View.SetViewXml($view.SchemaXml)
$wp.View.Update()
Save and Publish
$WebPartManager.SaveChanges($wp)
$page.CheckIn("updated Property")
For more information and better assistance refer to following documentation:- https://learn.microsoft.com/en-us/powershell/module/sharepoint-server/get-spwebpartpack?view=sharepoint-server-ps
https://learn.microsoft.com/en-us/microsoft-365/community/working-with-modern-clientside-pages-using-pnp-powershell
I hope this answer and resolve your issue, Accept answer if found helpful.
Thank You