我想将相同的文件上传到所有网站集中具有相同层次结构的多个网站集.我想使用PowerShell并包含自动签入/签出功能.
我能够在SharePoint中上传文件.下面是代码.:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
# create the Variable Path and Pass the source folder path
$path = “D:\ABC\DEF\26Nov\”;
# create the Variable destination and pass the URL of the SharePoint List
$destination = "complete URL of File will be mentioned here";
# 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 …Run Code Online (Sandbox Code Playgroud) powershell sharepoint powershell-2.0 sharepoint-2010 powershell-3.0