Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$FilePathCSV = import-csv Book1.csv
$webURL = "http://url"
$listName = "CSVInput"
$web = Get-SPWeb
$webURL $list = $web.Lists[$listName]
foreach($CurrentRwo in $FilePathCSV)
{
$field1 = $CurrentRwo.Name
$field2 = $CurrentRwo.Age
$newItem = $list.Items.Add()
$newItem["Title"] = $field1
$newItem["Age"] = $field2
$filebytes = [System.IO.File]::ReadAllBytes("Book1.csv")
$newItem.Attachments.Add("DummyFile Title",$filebytes)
$newItem.Update()
}
Read Next
Adding SharePoint Site as a Search Provider in Internet Explorer
Migrate data from Source to Destination Library without changing the audit trail column values– PowerShell
Tags
AAD
AI
API
ARM
ASPM
AWS
AWS Comprehend
AWS Secrets Manager
Actions
Amazon Bedrock
Angular
Ansible
Automation
Azure
Azure CLI
BDC
Bash
Bible API
Bitbucket
Bot
CI/CD
CLI for Microsoft 365
CSOM
Citrix
Cloud
Cloud Computing
Cloud Watch
CloudWatch
CodeWhisperer
Computer Vision API
Copilot
Data Extraction
DefectDojo
DevOps
DevSecOps
Docker
Docker Scout
Dotnet
EKS
Elastic Transcoder
EventBridge
External Secrets Operator
Faith
GCP
GenAI
Generative AI
GitHub
GitLab
GitLeaks
GitOps
Google Analytics
Governance
Graph API
Groups
HIBP API
Hashicorp
IAM
IaC
Identity
InfoPath
Integration
Istio
JQuery
JavaScript
Jenkins
Jinja2
Kiali
Kubernetes
LUIS
Lambda
LangChain
Linode
Linux
Lotus Notes
Machine Learning
Manage Secrets
Microservices
Microsoft 365
Microsoft Power Platform
Microsoft Teams
Migration
Milvus
NJSScan
Nintex
OIDC
Office Store
Ollama
OpenAI
Performance Optimization
Permissions
Pinecone
PnP
Pod
Postman
Power Apps
Power Automate
PowerApps
PowerShell
Python
REST
Redis
Roles
S3
SNS
SPFX
SQL Server
SSL
SSRS
Security
Semantic Search
Semgrep
Serverless
Service Mesh
ServiceNow
SharePoint
Slack
TFS
Teams
Terraform
VM
Vault
Vector Database
Vulnerability
Windows
Windows Server
YAML
Yammer
tfsec