将未知驱动器号中的项目复制到用户文件夹时出现问题。
代码如下:
Copy-Item -Path .((gwmi win32_volume -f 'label=''FlashDrive''').Name+'flex\\update\\log.txt') -Destination $ENV:UserProfile\test.txt;错误输出:
Copy-Item : A positional parameter cannot be found that accepts argument我该如何解决这个问题?
发布于 2018-06-11 17:54:21
如果确实存在标签为"FlashDrive“的设备,则应正常工作:
Copy-Item -Path ((gwmi win32_volume -f 'label=''FlashDrive''').Name + "flex\update\log.txt') -Destination $ENV:UserProfile\test.txt我在-Path之后删除了.,路径现在使用\而不是\\。
我在我的USB上测试了它,它工作了。
https://stackoverflow.com/questions/50794771
复制相似问题