Monday, April 11, 2011

Visual Studio & SharePoint: how to create package as part of the build process

In order to build a project and have the package created, this can be added to the project file (csproj, vbproj):

Monday, April 4, 2011

SharePoint 2010: PowerShell to delete a web part from the gallery

param($Identity = "", $Url = "")


$SPSite = New-Object Microsoft.SharePoint.SPSite($Url)

$SPWeb = $SPSite.OpenWeb()
$WebPartGallery = $SPWeb.Lists["Web Part Gallery"]
$gall = $WebPartGallery.Items select Name
$count = $gall.Count
for ($i =0; $i -lt $count;$i++)
if ($gall[$i] -match $Identity)
Write-Host "$Identity deleted"