我正在尝试从choco install
AppVeyor 中的命令中删除一些冗长的内容。这是我一直在尝试的(如建议here):
if (Test-Path "C:/ProgramData/chocolatey/bin/swig.exe") {
echo "using swig from cache"
} else {
choco install swig > NUL
}
但是它失败了:
Redirection to 'NUL' failed: FileStream will not open Win32 devices such as
disk partitions and tape drives. Avoid use of "\\.\" in the path.
At line:4 char:5
+ choco install swig > NUL
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : RedirectionFailed
Command executed with exception: Redirection to 'NUL' failed: FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path.
所以我的问题是有没有办法choco install
在 AppVeyor 的 PowerShell 中抑制命令的冗长?