I'm trying to add a text field to a document library with PowerShell PnP and set the maximum string length to 4
but I can't seem to figure out how and I'm getting nonsensical outputs.
When I add the field, I check if the property is available, but I can't set it?!
$field = Add-PnPField -DisplayName "Company" -InternalName "Company" -Type Text -AddToDefaultView -List $ListName -ErrorAction Stop
$field.IsPropertyAvailable("MaxLength")
$field | Set-PnPField -Values @{MaxLength=4}