我有这个脚本。希望在输出中包含,删除的项目,已发送的项目和草稿。
包含它的最佳方式是什么?
由于
Get-MailboxFolderStatistics myuserename -FolderScope Inbox | Where {$_.FolderPath -eq "/Inbox"}
答案 0 :(得分:0)
我所知道的最简单的方法是一次过滤多个文件夹是使用-match和正则表达式替换:
Get-MailboxFolderStatistics myuserename |
Where {$_.FolderPath -match '/Inbox|/Deleted Items|/Sent Items|/Drafts'}
答案 1 :(得分:0)
get-mailboxfolderstatistics myusername |其中{$ _。name -match" Inbox | Deleted | Sent | Calendar | Drafts"} | sort-object名称| ft Name,FolderPath,ItemsInFolder,FolderSize -auto