powershell - PowerShell - 清空已删除的项目和垃圾文件夹
问题描述
我正在使用以下代码清空已删除的项目和垃圾文件夹,因为它已满。但是在服务器中,它保存了一些数据,这些数据不会通过脚本或清理文件夹来删除。有人可以告诉我如何在空间用完时清理这两个文件夹。
Add-Type -assembly "Microsoft.Office.Interop.Outlook"
$Outlook = New-Object -comobject Outlook.Application
$namespace = $Outlook.GetNameSpace("MAPI")
$inbox = $namespace.GetDefaultFolder(3)
$readItems = $inbox.Items
$readItems | ForEach-Object{ $_.Delete() }
$junkEmail = $namespace.GetDefaultFolder(23)
$junkItems = $junkEmail.Items
$junkItems | ForEach-Object{ $_.Delete() }
解决方案
推荐阅读
- c++ - C++ 警告:在主文件中执行一次编译指示
- python-3.x - PyInstaller 3.6:模块 importlib 没有属性“机器”
- sql - 尽管覆盖了所有表上的索引,如何加快速度很慢的 4 路 SQLITE 内连接
- jquery - MVC 问题在按钮单击时从 JSon 对象填充 JQuery DataTable
- python - 捕获键盘事件
- sql - 在Postgresql中获取满足x条件的行的行号
- javascript - Instagram - 如何以编程方式滚动以加载关注者/关注者
- python - RuntimeError:给定组 = 1,大小为 [32、3、3、3] 的权重,预期输入 [1、4、160、40] 有 3 个通道,但有 4 个通道
- c - C 编程:错误:赋值给数组类型的表达式
- spatial-query - 为什么这个空间查询返回空?