This article describes a function of a custom SharePoint Online module available for download and installation on Technet Gallery and GitHub where it welcomes all your suggestions and contributions.



Set-SPOListColumn

Updates a list field/column.

Parameters

ListTitle  Mandatory  Name of the list 
FieldTitle Mandatory  Internal name or title of the field
DefaultValue  Optional  Default value of the field 
Description  Optional  String. 
Direction  Optional  'LTR','RTL','none'  Defines the direction of the text
EnforceUniqueValues  Optional 
Group  Optional  String. 
Hidden  Optional  Boolean. 
Indexed  Optional  Boolean. 
JSLink  Optional  String. 
ReadOnlyField  Optional  Boolean. 
Required  Optional  Boolean. 
SchemaXML  Optional  String. 
StaticName  Optional  String. 
Tag  Optional  String. 


Examples

----- EXAMPLE 1 ------
Set a column to be indexed.
Set-SPOListColumn -ListTitle MyList6 -Indexed $true -FieldTitle "fgd"


----- EXAMPLE 2 ------
Set columns to be ReadOnly and Required (dunno what for, it will only mess up the list).
$kolumny=(Get-SPOListFields -ListTitle MyList6).InternalName
foreach($kolum in $kolumny){Set-SPOListColumn -ListTitle MyList6 -FieldTitle $kolum -Required $true -ReadOnlyField $true}


----- EXAMPLE 3 ------
Set text direction to RTL (right-to-left).
$kolumny=(Get-SPOListFields -ListTitle MyList6).InternalName
foreach($kolum in $kolumny){Set-SPOListColumn -ListTitle MyList6 -FieldTitle $kolum -Direction RTL}


----- EXAMPLE 5 ------
"Unhide" a column.
Set-SPOListColumn -ListTitle MyList6 -FieldTitle "CSTColumn" -Hidden $false




See Also