Add custom webpart to a page using power shell
|
if((Get-PSSnapin « Microsoft.SharePoint.PowerShell » ) -eq $null) { Add-PSSnapin « Microsoft.SharePoint.PowerShell »}; [System.Reflection.Assembly]::LoadWithPartialName(« Microsoft.SharePoint ») [System.Reflection.Assembly]::LoadWithPartialName(« Microsoft.Publishing ») [System.Reflection.Assembly]::LoadWithPartialName(« System ») $site = new-object Microsoft.SharePoint.SPSite(« https://mysite »); $web = $site.OpenWeb() $fileDWP = $saveFolder + « myCustom.dwp » $errorMsg = « »...