Steps Involved:
- Open SharePoint 2010 Management Shell by going to Start | All Programs | SharePoint | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell (Run as Administrator).
- Run the following script.
Powershell Script:
## Delete all versions for the specified file using SharePoint 2010 web service in powershell
$uri="http://serverName:10736/sites/ECT/_vti_bin/Versions.asmx?wsdl"
## $fileName is the string that contains the site-relative URL of the file
[String]$fileName="Shared Documents/test.docx"
## Web Service Reference - http://Site/_vti_bin/Versions.asmx
$versionsWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
$versionsWebServiceReference.DeleteAllVersions($fileName)
All the versions for the specified is deleted successfully.

Join the conversation! Your thoughts help the community grow.