我们希望根据从网络中的设备的不同管理系统收到的电子邮件自动执行操作
我试过这个小脚本,但它只列出主题,而不是正文
# load rss-feed
$webclient = new-object System.Net.WebClient
# access the rss-feed
$webclient.Credentials = new-object System.Net.NetworkCredential ("scominbox@domain", "Password")
# download the rss as xml
[xml]$xml= $webclient.DownloadString("https://mail.google.com/mail/feed/atom")
# display only sender name and message title as custom table
$format= @{Expression={$_.title};Label="Title"},@{Expression={$_.author.name};Label="Author"}
# display the table
$xml.feed.entry | format-table $format
我如何阅读电子邮件?
答案1
答案2
# load rss-feed
$webclient = new-object System.Net.WebClient
# access the rss-feed
$webclient.Credentials = new-object System.Net.NetworkCredential ("username", "password")
# download the rss as xml
[xml]$xml= $webclient.DownloadString("https://mail.google.com/mail/feed/atom")
# display only sender name and message title as custom table
$format= @{Expression={$_.id};Label="id"},@{Expression={"|"};Label="|"},@{Expression={$_.author.email};Label="name"},@{Expression={"|"};Label="|"},@{Expression={$_.issued};Label="issued"},@{Expression={"|"};Label="|"},@{Expression={$_.summary};Label="summary"}
# display the table
$xml.feed.entry | format-table $format