如何使用 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
.