更新时间:2023-11-28 19:04:16
试试这个...
$directoryInfo = Get-ChildItem C:\temp | Measure-Object
$directoryInfo.count #Returns the count of all of the objects in the directory
如果$directoryInfo.count -eq 0
,那么你的目录是空的.
If $directoryInfo.count -eq 0
, then your directory is empty.