Sharing the Point

Office 365, SharePoint, Project Server – Blog

Posts Tagged ‘PowerShell’

SharePoint List- Show Hide List Column Using Powershell

Posted by Ashraf on May 18, 2012

Show/hide SharePoint list column in New/Edit form Using Powershell script

First get the website URL, list name and column objects

$webUrl = Get-SPWeb http://dev-pc/sites/dc

$listName = $web.Lists["Projects"]

$columnName = $list.Fields["Project Description"]

If you want to hide the column from Edit Form then Change the ShowInEditForm property and update objects

$columnName.ShowInEditForm = $false

If you want to hide the column from New Form then Change the ShowInNewForm property and update objects

$columnName.ShowInNewForm=$false

$columnName.Update()

$listName.Update()

$webUrl.Dispose()

Please change the WebUrl, list name and column name values as per your environment. To show the column just replace the $false values to $true.

..Sharing the Point>>

Posted in SharePoint | Tagged: , | Leave a Comment »

“Save site as template” SharePoint PowerShell Command

Posted by Ashraf on August 31, 2011

How to save a SharePoint  site as a site template using Powershell command

You can save your site as template even with the publishing feature using the following powershell command,

$Web=Get-SPWeb http://Servername:port/yourSite

$Web.SaveAsTemplate(“Template Name”,”Template Title”,”Template Description”,1)

In the forth parameter of SaveAsTemplate(), if you want to save the specified site as template along with data use 1, otherwise use 0.

After successfully running above commands, the newly created template will be available in site collection “Solutions” gallery.

Hope this helps.

Posted in SharePoint, System Administration | Tagged: , | 1 Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 59 other followers