windows – Powershell – 电子邮件免费空间信息
发布时间:2020-12-13 23:24:00 所属栏目:Windows 来源:网络整理
导读:我目前正在使用: $emailFrom = "user@host.com"$emailTo = "destination@host.com"$subject = "subject"$body = "message"$smtpServer = "mail.host.com"$smtp = new-object Net.Mail.SmtpClient($smtpServer)$smtp.Send($emailFrom,$emailTo,$subject,$bod
我目前正在使用:
$emailFrom = "user@host.com" $emailTo = "destination@host.com" $subject = "subject" $body = "message" $smtpServer = "mail.host.com" $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($emailFrom,$emailTo,$subject,$body) 我知道,通过以下命令,我可以找到我所有硬盘上的可用空间: Get-WmiObject WIN32_logicaldisk | sort -desc freespace | select -first 3 | format-table -autosize deviceid,devicetype,providername,freespace,size,volumename; 当我尝试这样做: $body = Get-WmiObject WIN32_logicaldisk | sort -desc freespace | select -first 3 | format-table -autosize deviceid,volumename; 但我收到的所有电子邮件都是以下内容: Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData Microsoft.PowerShell.Commands.Internal.Format.FormatEndData 如何使用powershell通过电子邮件获取我的免费空间?
尝试:
$body = Get-WmiObject WIN32_logicaldisk | sort -desc freespace |选择 – 第一个3 | format-table -autosize deviceid,volumename |出弦 我刚刚在我的电脑上试过它并且它有效. 有关其工作原理的一些背景,请参阅: http://blogs.msdn.com/powershell/archive/2006/04/25/how-does-select-string-work-with-pipelines-of-objects.aspx JR (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Windows的哈希
- ms-access – Microsoft Access中的Scope_Identity()
- windows-server-2008 – 病毒是否可以通过RDP连接使用的网络
- msbuild – TeamCity – Microsoft.Bcl.Build依赖项
- <EDEM 基础案例03>Block factory
- Windows 7上的C#Winform网格渲染速度很慢
- windows-server-2008 – Windows 7客户端的RDP数据加密错误
- 在Windows Server 2008上设置Mercurial时出错
- Windows Python版本和VC可再发行版本
- Windows Python:为什么第一个打开的窗口未显示为活动状态?
推荐文章
站长推荐
- Windows10 and MySQL安装
- windows环境下基于pycharm安装Redis出现的两个错
- WIN10桌面无创建文件夹选项,无法创建文件
- Windows Server 2008R2安装WEB服务器详细过程+安
- windows-server-2008 – Server Foundation 2012
- WiX MajorUpgrade的Windows服务,保留.config并避
- windows – WSUS和Pulled Patches
- winapi – Win32 API在当前的Windows版本中仍然是
- 使用Rundll32.exe执行DLL导出的函数
- 我可以将一个Windows(.bat)文件放在Visual Studi
热点阅读