您好我正在尝试在节点下的Sharepoint Web.Config文件中查找并删除重复节点,到目前为止我能够使用以下查询到达节点
$app = Get-SPWebApplication "http://mysite"
$apppath = $app.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].Path.ToString()
$path = $apppath + "\web.config"
$filecontents = [xml](Get-Content $path)
$dupRecords = $filecontents. configuration."system.webServer".modules.add |
Group-Object name |
where { $_.count -ne 1} |
select [int]{$_.count}
当我尝试此操作时失败并出现以下错误:
$dupRecords = $filecontents. configuration."system.webServer".modules.add | Group-Object name | where { $_.count -ne 1} | select [int]{$_.count}
有谁知道是否有更好的方法来解决这个问题或我的命令有什么问题?