start-bitstransfer 是否与 pester 兼容

is start-bitstransfer compatible with pester

当脚本中的 运行 start-bitstransfer 我试图将 pester 应用到...它似乎不起作用... 我只是尝试下载一些随机的 http 页面(同时准备做一些 tropico 5 ;)......到 pester testdrive,但这不起作用...... .net 不能与 pester 等一起使用吗?

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 using TestDrive:\somefile.txt use $TestDrive\somefile.txt instead.