Resolution:List View webpart sorting not working when added through powershell

Recently we faced a strange issue in one of our project. We added few list view webparts on different pages using powershell scripting as part of the deployment infrastructure. It was the usual scripting used everywhere. The listview webparts were added properly to the page with the following script   $web = Get-SPWeb <site url>…