[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
function GetSiteColumns($web)
{
foreach ($f in $web.Fields)
{
$data = @{"Id" = $f.Id
"Title" = $f.Title
"Type" = $f.Type
"Internal Name" = $f.InternalName
"Group" = $f.Group
}
New-Object PSObject -Property $data
}
}
$webUrl = "http://ssrap2"
GetSiteColumns(Get-SPWeb $webUrl) | Out-GridView
I've been uping my PowerShell skills as of late,
and here's a much more impressive way to achieve the same result
#function to load SharePoint Powershell snap in
function LoadSharePointPowerShellEnviroment
{
#clear the screen of pevious output
Clear-Host
write-host "Setting up Powershell enviroment for Sharepoint" -foregroundcolor Blue
Add-PSSnapin "Microsoft.Sharepoint.PowerShell" -ErrorAction SilentlyContinue
Write-host "Sharepoint PowerShell Snapin loaded." -foregroundcolor Green
}
#call sharepoint plugin function
LoadSharePointPowerShellEnviroment
$web = Get-SPWeb("http://Wingtip")
$web.Fields | Select-Object -Property id, Title, type,InternalName, Group | Out-GridView
$web.dispose()