2
我想使用PowerShell做一個WGET,並有輸出到一個文本文件。如何做一個Wget與PowerShell和輸出到一個文本文件
到目前爲止所有的嘗試都失敗了。
PS C:\Program Files (x86)\GnuWin32\bin> For ($i=1; $i -lt 5; $i++)
{wget.exe www.zillabunny.com | out-file C:\temp\wget.txt}
留下一個空的文本文件
和
For ($i=1; $i -lt 5; $i++) {wget.exe www.zillabunny.com} > C:\temp\wget.txt
給我
:術語 '>' 無法識別爲cmdlet,函數的名稱,腳本文件或可操作程序。檢查名稱的拼寫,或者如果包含路徑,請驗證路徑是否正確,然後重試。 At line:1 char:60 + For($ i = 1; $ i -lt 5; $ i ++){wget.exe www.zillabunny.com}> wget.txt +〜 + CategoryInfo:ObjectNotFound :(>:字符串)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException
非常感謝您!這也解釋了爲什麼有時當我測試的東西,我得到一個文本文件,說:「wget.exe www.zillabunny.com」4次 – zillabunny
嗯我覺得我實際上說得太快了,第一個代碼塊只是創建一個空的txt文件。 – zillabunny
第二個代碼塊也只是創建一個空白文本文件? – zillabunny