# create the Variable Path and Pass the source folder path
$path = “D:\Source File\”;
# create the Variable destination and pass the URL of the SharePoint List
$destination = “http://projectserver14:99/PWA/SharePointListURL/“;
# Store the current user default credentials in the Variable Credentials
$credentials = [System.Net.CredentialCache]::DefaultCredentials;
# Create the object of the Webclient
$webclient = New-Object System.Net.WebClient;
# Pass the user credentials
$webclient.Credentials = $credentials; Get-ChildItem
# “For Each” loop will upload all of the files one by one onto the destination using the UploadFile method
Get-ChildItem $path | ForEach-Object { $webclient.UploadFile($destination + “/” + $_.Name, “PUT”, $_.FullName)};
Note: User need to have an access to the SharePoint list to upload the documents.
Thanks. The upload was so quick !
I agree… and this was the first solution I found that did not require the PSSnapin. Very nice. Just what I needed. Thanks!