【发布时间】:2014-11-30 17:59:39
【问题描述】:
我在 powershell 中编写了函数,删除 IIS 中的虚拟文件夹,删除物理路径,将存档解压缩到文件夹,并在 IIS 中使用旧名称创建虚拟路径。步骤 2 中的问题。脚本尝试删除文件和文件夹。
...
get-childitem ($pathToIIs + "*") -recurse | remove-item -Force -recurse
...
Powershell 抛出错误:
无法删除项目 C:\inetpub\test\css:目录不为空。 + CategoryInfo : WriteError: (css:DirectoryInfo) [Remove-Item], I 异常 + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell .Commands.RemoveItemCommand + PSComputerName : test.cloudapp.net
如果理解正确,停止和启动 IIS 是个坏主意。那么如何修复这个错误呢?
【问题讨论】:
标签: powershell iis