我的剧本
[ { _id: '59385ef6d2d80c00d9bdef97', count: 1000, user: [_id:"59385ef6d2d80c00d9bdef97",name:"XX"] } ]
请帮我解决脚本
答案 0 :(得分:1)
避免重复查询wmi
,反转逻辑:
$TestPath = 'd:\test path'
$AllShares = Get-WmiObject -Class Win32_Share
Get-ChildItem $TestPath -Directory <#-Recurse<##> -Force -ErrorAction SilentlyContinue |
ForEach-Object{
$vari = $_.FullName -in $AllShares.Path
if (<#$true -or <##> $vari) { '{0,-6}{1}' -f $vari, $_.FullName }
}
(可选)删除阻止评论开始标记<#
(您可以保留<##>
)。