TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Update Choice Field Value using Powershell SharePoint
Sushant Kesari
Dec 10
2015
Code
8.3
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Add-PSSnapin Microsoft.SharePoint.PowerShell
$webURL = Read-Host
"Please enter your SiteCollection Url"
$spSite = New-Object Microsoft.SharePoint.SPSite($webURL)
$web = $spSite.OpenWeb()
$list = $web.Lists[
"Customer"
]
Write-Host “Updatiing Category field values'
for
:- ” $list.Title -ForegroundColor Yellow
$CategoryField = $list.Fields[
"Categories"
];
$ChoicesArray = @(
"Product related"
,
"Production"
,
" (HR)"
,
" Code of Business Conduct"
,
"Sustainability"
);
#remove old values
$CategoryField.choices.clear()
#update new values
$CategoryField.choices.addrange($ChoicesArray)
$CategoryField.Update()
Write-Host “Category field value updated successfully” -ForegroundColor Green
$web.Dispose()
Remove-PSSnapin Microsoft.SharePoint.PowerShell
Powershell Script
SharePoint
Update Choice Field Value in SharePoint