我希望從PowerShell中選擇第三行文本。Powershell:從字符串中提取第二行
我已經從電子郵件的身體來的字符串:
$olFolderInbox = 6
$outlook = new-object -com outlook.application;
$ns = $outlook.GetNameSpace("MAPI");
$inbox = $ns.GetDefaultFolder($olFolderInbox)
foreach ($email in $inbox.items){
if($email.Subject -eq "PASSED") {
$Body = $email.Body
write-host $emailSentOn
write-host $email.Body
}
}
的$車身字符串格式如下所示:
<BLANK LINE>
Queue Cleared!
Server Name
Username
我想從4確切的服務器名稱行文本字符串。
感謝
輝煌!坦克你的快速反應! :) –