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
PowerShell script to upload Excel File into SharePoint List
Krishna Murthy
Aug 13
2015
Code
3.6
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
If((Get - PSSnapin | Where
{
$_.Name - eq
"Microsoft.SharePoint.PowerShel"
}) - eq
null
) {
Add - PSSnapin Microsoft.SharePoint.PowerShel
}
$web = Get - SPWeb http:
//sharepoint/
$list = $web.lists(
"RMD FRSN Data"
)
$cnt = 0
foreach
($i
in
Import - CSV File.csv)#put your file name
in
place of file.csv
{
$
new
= $list.Items.Add()
$
new
[
"EmployeeCode"
] = i.EmployeeCode
$
new
[
"SalesOrganization"
] = i.SalesOrganization
$
new
[
"CreatedAt"
] = i.CreatedAt
$
new
.Update()
$cnt++
}
"Added "
+ $cnt.ToString() +
" records."
PowerShell
SharePoint List