Redirection to 'NUL' failed: FileStream will not open Win32 devices
nul
is batch syntax. In PowerShell you can use $null
instead, as Mathias R. Jessen pointed out in his comment:
choco install swig > $null
Other options are piping into the Out-Null
cmdlet, collecting the output in a variable, or casting it to void
:
choco install swig | Out-Null$dummy = choco install swig[void](choco install swig)