下载使用 powershell 通过 https 调用生成的文件

Download a file which is generated through https call using powershell

目前我有这么一小段代码。 URL https://dosomething.do 生成一个 .csv 文件。我可以 运行 powershell 代码并且在 shell 中我可以看到文件的内容。但是文件本身并没有下载。我想指定下载后的保存位置。我在这里有什么选择?

$securepassword = ConvertTo-SecureString "xxx" -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential("hxxx", $securepassword)
Invoke-WebRequest -Uri "https://dosomething.do" -Credential $credentials

使用Invoke-WebRequest-OutFile参数:

Invoke-WebRequest -Uri "https://dosomething.do" -OutFile C:\some\path\to\yourfile.csv