Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
PowerShell script to upload Excel File into SharePoint List
WhatsApp
Krishna Murthy
Aug 13
2015
3.7
k
0
0
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
Up Next
PowerShell script to upload Excel File into SharePoint List