I have following code
which allows me to transfer automatically one file to sharepoint. Is it possible to modify it the way it will upload every file from Temp to DL ? Thank you:
# Set the variables
$WebURL = “http://contoso.com/spaces/”
$DocLibName = “Doc_DL”
$FilePath = “C:\Temp\PSW”
# Get a variable that points to the folder
$Web = Get-SPWeb $WebURL
$List = $Web.GetFolder($DocLibName)
$Files = $List.Files
# Get just the name of the file from the whole path
$FileName = $FilePath.Substring($FilePath.LastIndexOf("\")+1)
# Load the file into a variable
$File= Get-ChildItem $FilePath
# Upload it to SharePoint
$Files.Add($DocLibName +"/" + $FileName,$File.OpenRead(),$false)
$web.Dispose()