PowerShell 5.1中Expand-Archive报DestinationPath参数错误的原因
问题原因与解决办法
这不是操作失误,是PowerShell版本间的参数差异导致的:
- PowerShell 7.x 中
Expand-Archive支持-DestinationPath参数(同时兼容旧的-OutputPath) - 但PowerShell 5.1里,该命令指定目标路径的参数是**
-OutputPath**,而非-DestinationPath,所以你用后者会触发参数不存在的错误
修正后的PowerShell 5.1可用命令:
Expand-Archive -Path $Path\compressed.zip -OutputPath $Path\Destination
内容的提问来源于stack exchange,提问作者Smit Patel
相关产品推荐
相关产品推荐

