使用Powershell处理SharePoint列表 [英] Working with SharePoint Lists with Powershell

查看:87
本文介绍了使用Powershell处理SharePoint列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过PowerShell更新Office 365中的SharePoint列表.我需要能够通过PowerShell对列表项进行标准的CRUD(创建,读取,更新和删除).我正在自动寻找要显示数据集的数据.

I am trying to update a SharePoint list in office 365 via PowerShell. I need to be able to do the standard CRUD (Create, read, update, and Delete) of list items via PowerShell.  I am automatically sourcing data I want to present the dataset.

我尝试过

我已经看到了使用以下SharePoint 2013的旧脚本,但无法在Windows 10工作站上运行它.它似乎没有"Microsoft.SharePoint.PowerShell"因为最新的SharePoint工具似乎没有使用 相同的管理单元.

I have seen old script for using the following SharePoint 2013 but I cant get it to work from my windows 10 workstation.  It doesn't seem to have the "Microsoft.SharePoint.PowerShell" as the latest SharePoint tools don't seem to use the same snap-in.

cls
if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
    Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

$sourceWebURL = "http://sharepointsite"
$sourceListName = "mylist"

$spSourceWeb = Get-SPWeb $sourceWebURL
$spSourceList = $spSourceWeb.Lists[$sourceListName]
#$spSourceItems = $spSourceList.GetItems()
#$spSourceItems = $spSourceList.GetItemById("1")
$spSourceItems = $spSourceList.Items | where {$_['ID'] -eq 1}

$spSourceItems | ForEach-Object {
    Write-Host $_['ID']
    Write-Host $_['Title']
}

示例脚本来自:

http://www.robertkuzma.com/2012/09/09,从共享点列表中使用powershell-script/

sample script from:

http://www.robertkuzma.com/2012/09/get-items-from-sharepoint-list-using-powershell-script/

推荐答案

请检查以下内容

http://www.sharepointdiary.com/2015/07/sharepoint-online-update-list-items-using-powershell.html

http://www.sharepointdiary.com/2015/07/sharepoint-online-update-list-items-using-powershell.html


这篇关于使用Powershell处理SharePoint列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆