Pages

Thursday, October 11, 2012

How to print fields information using PowerShell

Many times we need to print fields information to understand, for example, which is the name of the fields we looking for. You know, SharePoint has a naming convention that is different from what we expect.

To be able to quickly obtain this information I use Powershell with the following script:

$url = Read-Host "Web address:"
$web = Get-SPWeb $url
$listname = Read-Host "List name:"
$list = $web.Lists[$listname]

$list.fields | select Title, InternalName, Hidden, DisplayName | sort title | ft -AutoSize

enjoy

No comments:

Post a Comment