-
Notifications
You must be signed in to change notification settings - Fork 399
Description
Error encountered = "Error: A parameter cannot be found that matches parameter name 'ReturnType'."
The documentation clearly mentions the parameter "ReturnType" for the cmdlet Add-PnpField, provided the "Calculated" type is set as well.
This is failing:
Add-PnPField -DisplayName $ctTypeField.Displayname -InternalName $ctTypeField.Name -Type $ctTypeField.Type -Formula $ctTypeField.Formula -ReturnType $ctTypeField.ReturnType -Group "Contract Columns"
While removing the ReturnType parameter and value from the command works as expected (but sets the OutputType to "Text").
Seeing that there is a value 'OutputType' in the output for Get-PnpField, I have also tried using the parameter "-OutputType" instead of "-ReturnType", but that failed as well (to be expected, I guess, as this is not documented)
I also tried using Set-PnpField to set the value of "OutputType" after adding the field, but that failed with an warning that I should not use the string "Number": "WARNING: Setting property 'OutputType' to 'Number' failed with exception 'Object of type 'System.String' cannot be converted to type 'Microsoft.SharePoint.Client.FieldType'.'. Value will be ignored."
What is the version of the Cmdlet module you are running?
ModuleType Version PreRelease Name PSEdition ExportedCommands
Manifest 2.2.0 PnP.PowerShell Desk {Add-PnPAdaptiveScopeProperty, Add-PnPPropertyBagValue, Add-PnPSiteClassification, Copy-PnPFolder…}
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify