gpt4 book ai didi

powershell - 找不到接受参数 'Files\'的位置参数

转载 作者:行者123 更新时间:2023-12-03 00:42:23 32 4
gpt4 key购买 nike

如果我将目标路径作为C:\ Program Files \传递,则会尝试在powershell中使用Expand-Archive解压缩文件,但出现以下错误。但是,如果我指定C:\ Users \ test \ Downloads,则可以使用。

PS C:\Users\test\Downloads> Expand-Archive -Path C:\Windows\Temp\nginx-1.16.1.zip -DestinationPath  C:\Program Files\

Error:
Expand-Archive : A positional parameter cannot be found that accepts argument 'Files\'.
At line:1 char:1
+ Expand-Archive -Path C:\Windows\Temp\nginx-1.16.1.zip -DestinationPat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Expand-Archive], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Expand-Archive

我尝试传递'$ env:PROGRAMFILES'并得到相同的错误。
Expand-Archive -Path C:\Windows\Temp\nginx-1.16.1.zip -DestinationPath '$env:PROGRAMFILES' 

如何将参数C:\ Program Files \作为目标路径传递到Powershell。

最佳答案

您遇到的问题是您使用的C:\Program Files\包含一个空格,因此需要包装为"C:\Program Files\"才能完成PowerShell。

关于powershell - 找不到接受参数 'Files\'的位置参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58243982/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com