此代码:递归设置文件属性
Get-ChildItem $targetConfig -Recurse | Set-ItemProperty -Name IsReadOnly -Value $false
返回几个错误:
Set-ItemProperty : Property System.Boolean IsReadOnly=False does not exist. At line:1 char:56 + Get-ChildItem $targetConfig -Recurse | Set-ItemProperty <<<< -Name IsReadOnly -Value $false + CategoryInfo : ReadError: (System.Boolean IsReadOnly=False:PSNoteProperty) [Set-ItemProperty], IOException + FullyQualifiedErrorId : SetPropertyError,Microsoft.PowerShell.Commands.SetItemPropertyCommand
这是什么错误意味着什么?
一个环线条件可以是:'其中{ - 不是$ _ psiscontainer}'。在Powershell V3中只需将'-File'开关添加到'getchilditem'。 –