PowerShell DSC + IIS共享configuration

我试图设置TFS发布pipe理部署到IIS服务器设置为共享configuration。 但是,部署实际运行时,出现以下错误:

##[debug]System.Exception: Filename: \\?\UNC\storage\webfarm\config\applicationHost.config Error: Cannot write configuration file due to insufficient permissions ##[error]Filename: \\?\UNC\storage\webfarm\config\applicationHost.config ##[error]Error: Cannot write configuration file due to insufficient permissions 

用于运行DSC脚本的用户具有修改applicationhost.config的权限。 这是一个红鲱鱼错误,还是我们错过了什么?

更新:我已经testing了将共享configuration移动到Windows服务器共享,以确保它不是一个SAN问题,但是,导致了一个不同的错误:

 Cannot commit configuration changes because the file has changed on disk 

如果其他脚本尝试同时执行某些操作,我以前遇到过这个问题,但是我已经将configuration切换到了创build应用程序的最低限度。

唯一一次能够实现它的是打破共享configuration并返回本地。 这是不理想的,因为我们在农场configuration中运行。

DSC在本地系统上下文中运行。 如果要在用户的上下文中执行某个任务,请使用RunAs。 这个博客解释相同。 http://nanalakshmanan.com/blog/Understanding-RunAs/