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 Attachment in Richtext Fields in SharePoint
Balaji Vishwanath
Aug 26
2015
Code
995
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
#
Add SharePoint PowerShell Snapin which adds SharePoint specific cmdlets
Add - PSSnapin Microsoft.SharePoint.PowerShell - EA SilentlyContinue
# Variables that we are going to use
for
list editing
$webURL =
"someurl/"
$listName =
"Demo List"
#
Get the SPWeb
object
and save it to a variable
$web = Get - SPWeb $webURL
# Get the SPList object to retrieve the "Demo List"
$list = $web.Lists[$listName]
# Get all items in this list and save them to a variable
$items = $list.items
# Go through all items
foreach
($item
in
$items) {#
If the
"Title"
column value equals
"My first item!"
do
something with it
if
($item[
"Title"
] - eq
"test1"
) {#
Change the value of the
"Title"
column
$item[
"Remarks"
] =
"My first edited item! test1"
#
Update the item
$item.Update()
}
}
Update rich text fields attachment
SharePoint