我收到了一个文件夹,需要删除所有名称类似于“tempspecssuite_”的子文件夹。我的文件夹结构如下所示。我想递归删除名称类似于tempspecssuite_的文件夹。尝试使用下面的命令但没有成功。
Get-Childitem -path C:\folder1 -Recurse | where-object {$_.Name -ilike "*tempspecssuite_*"} | Remove-Item -Force -WhatIf
$ .Name
应该是$ _.Name
。 - undefined