What I'm trying to accomplish is referencing a calendar on every site designated, adding a named text column to that calendar, then hiding that created column from the New and Edit form. I think I'm just about there but I'm not great with PowerShell so I think I've got some pieces mixed up.
Edit: An additional part to this would be great if I could include the Calendar on the default page "home.aspx".
Add-PsSnapin Microsoft.SharePoint.PowerShell
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteNumbers = "03", "14", "22035", "22036", "22040", "22041", "22042", "22043", "22044", "2210", "31"
Foreach($wnl in $siteNumbers)
{
$rootWeb = (Get-SPWeb ("http://site/path/" + $wnl))
#Get an reference to the calendar
$calendarlist=$rootWeb.Lists["Calendar"]
#Get a reference to a text field
$fieldtype=[Microsoft.SharePoint.SPFieldType]::Text
#Add a new test text field to the calendar
$calendarlist.Fields.Add("GCID", $fieldtype, $false)
#Get a reference to the created field
$CalField = $calendarlist.Fields["GCID"]
#Hide the column in New and Edit Mode
$CalField.ShowInEditForm = $false
$CalField.ShowInNewForm = $false
#Push Update
$CalField.Update()
$calendarlist.Update()
The above code referenced the calendar on each site added the column "GCID" but it did not hide it. Do I need to create the column, do the list.update, then hide the column from new/edit, then do the column.update?