Skip to content

Instantly share code, notes, and snippets.

@sebastienlevert
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastienlevert/c895f007330fb17a24c2 to your computer and use it in GitHub Desktop.
Save sebastienlevert/c895f007330fb17a24c2 to your computer and use it in GitHub Desktop.
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