Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Execute-Set-FieldVisibility01.ps1
#-----------------------------------------------------------------------
# Loads the Set-Visibility Cmdlets
#-----------------------------------------------------------------------
. .\Set-FieldVisibility.ps1
#-----------------------------------------------------------------------
# Connects to your Office 365 SharePoint Online tenant
#-----------------------------------------------------------------------
Connect-SPOnline -Url https://<tenant>.sharepoint.com -Credentials <credentialslabel>
#-----------------------------------------------------------------------
# Gets the desired List based on its Url
#-----------------------------------------------------------------------
$list = Get-SPOList -Identity "Lists/<Name>"
#-----------------------------------------------------------------------
# Gets the desired Field based on its internal name and its containing List
#-----------------------------------------------------------------------
$field = Get-SPOField -List $list -Identity "InternalName"
#-----------------------------------------------------------------------
# Set the Field Visibility configuration
#-----------------------------------------------------------------------
Set-FieldVisibility -Field $field -ShowInNewForm $false -ShowInEditForm $false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.