I am trying to remove some verbosity from a choco install
command within AppVeyor. Here is what I been trying (as suggested here):
if (Test-Path "C:/ProgramData/chocolatey/bin/swig.exe") {
echo "using swig from cache"
} else {
choco install swig > NUL
}
However it fails with:
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.
So my question is there a way to suppress the verbosity of a choco install
command within PowerShell on AppVeyor?
choco install swig > $null
– Embouchure-y
to the argument as it may fail to finish installing depending on the version of choco. – Subacid