2012-03-29 48 views
0

我想知道如何運行一個像這樣的文件:運行文件

Search-Mailbox -Identity arrwest -SearchQuery 「Subject:MLIS Volume Report」,」From:cmctrymullin」,」Sent:today」 -DeleteContent 
Search-Mailbox -Identity ceringle -SearchQuery 「Subject:MLIS Volume Report」,」From:cmcmtrullin」,」Sent:today」 -DeleteContent 

我有大約1000行,我需要在Exchange 2010中的PowerShell

運行

我該怎麼做?

+0

我發現,所有你要做的就是把它放在一個PS1文件。但是當我確實運行它時,我必須確認EVERY SINGLE行並按Y – 2012-03-29 00:27:26

+2

嘗試添加-Confirm:$ false – mjolinor 2012-03-29 01:20:34

回答

1

發出此命令在shell執行你的腳本之前:

$ConfirmPreference = "None" 

Reference