Posts

Showing posts from 2011

Remove duplicate strings - C#

Here is the code 1 2 3 var words = new HashSet(); string text = "praveen kumar thalluri praveen kumar thalluri" ; text = Regex.Replace(text, "\\w+" , m => words.Add(m.Value.ToUpperInvariant())? m.Value: String.Empty); Courtesy: http://stackoverflow.com/questions/1058783/regular-expression-to-find-and-remove-duplicate-words

SharePoint 2010 PowerShell commands

Windows PowerShell is better command tool and SharePoint leverages it most to send powerful commands to the product. I was really impressed with this tool. The commands are very explanatory. Easy to remember. Easy to work on as well. When I did execute my first command I had to bite a bullet. I got the following error. Install-SPSolution : This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application . The reason i got this error is that I got my solution as a  gobal solution. So don't mention any targeted web application to deploy this kind of solutions Here are few major commands of SharePoint PowerShell //Add solution Add-SPSolution C:\Test\test.wsp //Deploy solution to web app Install-SPSolution –Identity test.wsp –WebApplication http://sharepoint2010:1111 -GACDeployment //Retract solution from web app Uninstall-SPSolution –Identity test.wsp –WebApplication http://sharepoint2010:1111