Steps to reproduce
Expected behavior
I expect the variable $foo to contain the string Docker version 19.03.11, build dd360c7 since running docker -v like below returns that data
PS > docker -v
Docker version 19.03.11, build dd360c7
Actual behavior
It errors
write /dev/stdout: permission denied
Environment data
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Linux 5.8.0-33-generic #36-Ubuntu SMP Wed Dec 9…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Ubuntu version: 20.10
Installed powershell with Snap
I originally raised this as a stackoverflow question -> https://stackoverflow.com/questions/65260463/how-to-capture-docker-version-in-powershell-cross-platform but I believe it is a bug.
The equivalent code works in bash
#> VERSION=$(docker -v)
#> echo $VERSION
I believe it also works on Ubuntu 20.04 when pwsh is installed with apt-get, but as fair as I can tell you can only install pwsh with snap on 20.10
Steps to reproduce
Expected behavior
I expect the variable $foo to contain the string
Docker version 19.03.11, build dd360c7since runningdocker -vlike below returns that dataActual behavior
It errors
Environment data
I originally raised this as a stackoverflow question -> https://stackoverflow.com/questions/65260463/how-to-capture-docker-version-in-powershell-cross-platform but I believe it is a bug.
The equivalent code works in bash
I believe it also works on Ubuntu 20.04 when pwsh is installed with apt-get, but as fair as I can tell you can only install pwsh with snap on 20.10