如何使用PowerShell修改SharePoint列表中项目的值?当我尝试以下方法:如何使用PowerShell修改SharePoint列表中项目的值
$splist.GetItems() | ForEach-Object{
#Write-Host $_["Item"]
if($_["Item"] -eq $null){
$SPFileCollection = $folder.Files
$upFile=Get-ChildItem D:\Tools\SP-scripts\MDNSO-template.aspx
$tmpValue = $_["Title"]
$filename = "EM_Doc_Library\$tmpValue"
$SPFileCollection.Add("EM_Doc_Library\$tmpValue",$upFile.OpenRead(),$false)
Write-Host "creating the file"
Write-Host $_["Title"]
$_["Item"] = "MDNSO-<$tmpValue>"
}
}
它说,unable to index into an object of type SPlistItem
。
哪一行引发错误? –
fucntion添加(),它说异常调用添加3个参数 – LifeScript
你能帮我吗?我可以找出几个小时! – LifeScript