process{if($ClientContext-eq$null){throw"Cannot bind argument to parameter 'ClientContext' because it is null."}$XmlDocument=New-ObjectSystem.Xml.XmlDocument$FieldElement=$XmlDocument.AppendChild($XmlDocument.CreateElement('Field'))$FieldElement.SetAttribute('Type','Currency')$FieldElement.SetAttribute('Name',$Name)$FieldElement.SetAttribute('DisplayName',$Title)if($PSBoundParameters.ContainsKey('Identity')){$FieldElement.SetAttribute('ID',$Identity)}if($PSBoundParameters.ContainsKey('Description')){$FieldElement.SetAttribute('Description',$Description)}if($PSBoundParameters.ContainsKey('Required')){$FieldElement.SetAttribute('Required',$Required.ToString().ToUpper())}if($PSBoundParameters.ContainsKey('EnforceUniqueValues')){$FieldElement.SetAttribute('EnforceUniqueValues',$EnforceUniqueValues.ToString().ToUpper())$FieldElement.SetAttribute('Indexed',$EnforceUniqueValues.ToString().ToUpper())}if($PSBoundParameters.ContainsKey('MinimumValue')){$FieldElement.SetAttribute('Min',$MinimumValue)}if($PSBoundParameters.ContainsKey('MaximumValue')){$FieldElement.SetAttribute('Max',$MaximumValue)}if($PSBoundParameters.ContainsKey('Decimals')){$FieldElement.SetAttribute('Decimals',$Decimals)}if($PSBoundParameters.ContainsKey('LocaleId')){$FieldElement.SetAttribute('LCID',$LocaleId)}if($PSBoundParameters.ContainsKey('DefaultValue')){$DefaultElement=$FieldElement.AppendChild($XmlDocument.CreateElement('Default'))$DefaultElement.InnerText=$DefaultValue}$AddFieldOptions=[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldInternalNameHint$ClientObject=$ParentObject.ClientObject.Fields.AddFieldAsXml($XmlDocument.InnerXml,$AddToDefaultView,$AddFieldOptions)Invoke-ClientContextLoad`-ClientContext$ClientContext`-ClientObject$ClientObject`-Retrieval$Retrieval$ClientObject=Convert-SPClientField`-ClientContext$ClientContext`-Field$ClientObjectWrite-Output$ClientObject}