Powershell更新网络媒体资源 [英] Powershell to update web property

查看:70
本文介绍了Powershell更新网络媒体资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,

我正在尝试创建Powershell脚本,该脚本应从excel文件中获取输入并更新SharePoint网站的Web属性.谁能帮助我为这种情况创建脚本.基本上我想知道如何循环并将参数传递给以下脚本.

I am trying to create Powershell script which should take input from excel file and update web property of a SharePoint site. can anyone help me in creating script for this scenario. Basically i want to know how to loop and pass parameters to below script.

$ web = Get-SPWeb<源站点">

$ web.Properties ["myproperty"] =<目标站点">

$web.Properties["myproperty"] = "<Target Site>"

$ web.Properties.Update()

$web.Properties.Update()

输入文件如下所示:

推荐答案

尝试以下代码;

Try Below code;


file ="D:\ Textfile \ yourinputfile.xlsx"
file = "D:\Textfile\yourinputfile.xlsx"


sheetName ="Sheet1"
#创建Excel.Application的实例并打开Excel文件
sheetName = "Sheet1"
#Create an instance of Excel.Application and Open Excel file


这篇关于Powershell更新网络媒体资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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