【发布时间】:2011-09-28 01:02:37
【问题描述】:
我有一个网站,我想使用 powershell 为其激活功能
当我运行以下命令时:
enable-spfeature FEATURE NAME -url http://URL
它会抛出一个错误:value cannot be null parameter name section.
它基本上找不到位于 Web 应用程序配置下的配置部分。如果我创建一个名为 powershell.exe.config 的文件并将其放在 powershell 文件夹,它工作正常,但我不想触摸系统文件夹。
是否可以为 powershell 提供位于其他文件夹中的配置路径,并要求它在激活功能时使用该路径。
我尝试过这样的事情,但没有运气
$configpath = "C:\DevTools.exe.config"
[System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE",$configpath)
enable-spfeature Feature name -url http://url
【问题讨论】:
标签: c# sharepoint powershell