当我在脚本中运行start-bitstransfer时,我试图将事情应用到...上,这似乎不起作用...
我只是尝试下载一些随机的http页面(同时准备做一些tropico 5;)...到杵测试驱动器,但是这不起作用...
.net的东西不适用于paster或类似工具吗?
set-content "testdrive:\bla.txt" -value "bla"
Start-BitsTransfer -source "http://www.tropicostrategy.com/p/blog-page.html" -destination 'testdrive:\' -Description "Downloading test"
Get-ChildItem 'TestDrive:\' | out-file c:\temp\b.txt
输出:
Describing get-wallhavens
[-] downloads a file 591ms
ArgumentException: Value does not fall within the expected range.
ArgumentException: An incorrect value is specified in the Source parameter or in the Destination parameter. Verify that the directory and file names in the Source and Destination parameters are correct.
at <ScriptBlock>, D:\stack\Projects\Personal\wallchange\download-wallpaper.Tests.ps1: line 7
最佳答案
The documentation on GitHub指示您需要使用一个变量来保存临时存储的实际位置:
Working with .NET Objects
When working directly with .NET objects, it's not possible to use the convenient
TestDrive:\
PSDrive. Instead you need to use the$TestDrive
variable which holds the actual path in a format that .NET understands. For example instead of usingTestDrive:\somefile.txt
use$TestDrive\somefile.txt
instead.
关于powershell - 起始位转移与paster兼容吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51342309/