PowerShell to Get-Set "Yes/No (Check box)" Field Value in SharePoint
Requirement: PowerShell to get and set Yes/No field value in SharePoint
SharePoint: Get Yes/No Field Value using PowerShell
Here is the PowerShell to read Yes/No field programmatically in SharePoint.
This gets the value of yes/no field from the given list.
Update Yes/No Field in SharePoint List using PowerShell
PowerShell to Update Yes No field SharePoint list programmatically
SharePoint: Get Yes/No Field Value using PowerShell
Here is the PowerShell to read Yes/No field programmatically in SharePoint.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Set variables $WebURL="http://intranet.crescent.com" $ListName ="ProjectTemp" $FieldName="IsActive" #Internal Name $ListItemID="1" #Get Web and List Objects $Web = Get-SPWeb $WebURL $List = $Web.Lists[$ListName] #Get the List Item by ID $ListItem = $List.GetItembyID($ListItemID) #Get the Yes/No Field Value $ListItem[$FieldName]
This gets the value of yes/no field from the given list.
Update Yes/No Field in SharePoint List using PowerShell
PowerShell to Update Yes No field SharePoint list programmatically
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Set variables $WebURL="http://intranet.crescent.com" $ListName ="Projects" $FieldName="IsActive" #Internal Name $ListItemID="1" #Get Web and List Objects $Web = Get-SPWeb $WebURL $List = $Web.Lists[$ListName] #Get the List Item to update $ListItem = $List.GetItembyID($ListItemID) #Update the Yes/No Field Value $ListItem[$FieldName] = $False $ListItem.Update()
No comments:
Please Login and comment to get your questions answered!