Tôi muốn thử chuyển tập lệnh bash của tôi từ linux sang powershell nhưng không thể hiểu tại sao nó không thành công.Làm thế nào để làm wget với cookie trong PowerShell
Linux lệnh:
wget -q -x --user-agent="blablabla" --keep-session-cookies --load-cookies cook.txt http://site.com/qqq
đang PowerShell:
$source = "http://site.com/qqq"
$destination = "d:\site\qqq"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($source, $destination)
nhưng mã này chỉ tải trang mà không cần cookie. Và tôi không thể tìm thấy làm thế nào tôi có thể gửi PHPSESSID đến trang web.
Vui lòng giải thích cho tôi cách thực hiện.
Bạn có muốn chọn một cửa sổ không? http://superuser.com/questions/25538/what-is-the-windows-equivalent-of-wget – PeskyGnat