From a4e34aeb077881225fd6fb9d5431bde3e0d7b9fd Mon Sep 17 00:00:00 2001 From: Lukas Pfeifhofer <60177899+lukas-pfeifhofer@users.noreply.github.com> Date: Fri, 17 May 2024 12:18:58 +0200 Subject: [PATCH] compatibility with pwsh (#3526) Using an empty string as parameter not works in pwsh. **This code fails in PS7.x** ```powershell $a = "" docker ps $a ``` **This code works in PS5.x and PS7.x** ```powershell $a = $null docker ps $a ``` --- ContainerInfo/Test-NavContainer.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ContainerInfo/Test-NavContainer.ps1 b/ContainerInfo/Test-NavContainer.ps1 index 3f4fdd441..6d18c4831 100644 --- a/ContainerInfo/Test-NavContainer.ps1 +++ b/ContainerInfo/Test-NavContainer.ps1 @@ -23,7 +23,7 @@ try { $id = "" $a = "-a" if ($doNotIncludeStoppedContainers) { - $a = "" + $a = $null } $id = docker ps $a --no-trunc --format "{{.ID}}/{{.Names}}" | Where-Object { $containerName -eq $_.split('/')[1] } | ForEach-Object { $_.split('/')[0] }