Powershell检查列表中的项目是文件夹还是文件,如果文件夹创建了文件夹,则退出 [英] Powershell to check if item in the list is folder or file if folder create the folder else exit

查看:173
本文介绍了Powershell检查列表中的项目是文件夹还是文件,如果文件夹创建了文件夹,则退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

需要创建一个Power Shell脚本,在该脚本中将检查列表中的项目,如果该项目是文件夹,则将创建它,否则就继续.

Need to create a power shell script where it will check item in the list and if the item is folder it will create it or else just continue.

推荐答案

Hi Amol,

Hi Amol,

根据您的描述,您要检查列表中的一个项目,如果该项目是文件夹,请在列表中创建一个新项目.是吗?

From your description, you want to check an item in a list, if the item is folder, create a new item in the list. Is it right?

有一个演示供您参考:

Add-PSSnapin Microsoft.SharePoint.PowerShell;


sourceWebURL ="http://sp13/sites/test1"
sourceWebURL = "http://sp13/sites/test1"


sourceListName =供应商"; #将其更改为列表的名称
sourceListName = "Vendor" #change it to the name of your list


这篇关于Powershell检查列表中的项目是文件夹还是文件,如果文件夹创建了文件夹,则退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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