How to Add Geolocation field in Office 365/SharePoint 2016/2019 using Powershell

Hello SharePointers,

Here are the Powershell script to add Geolocation field in Office 365/SharePoint 2016/2019 using Powershell.

$list = $web.Lists.GetByTitle(“My Google/Bings Maps)
$ctx.Load($list)
$ctx.ExecuteQuery()

$geolocationmap=$list.Fields.AddFieldAsXml(“”, $true, [Microsoft.SharePoint.Client.AddFieldOptions]::AddToAllContentTypes)
$list.Update()
$ctx.ExecuteQuery()

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *