Skip to content

Commit 06b8b9d

Browse files
author
ntrappe-msft
committed
add network exists check
1 parent a3853a4 commit 06b8b9d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

helpful_tools/Install-DockerCE/install-docker-ce.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ Install-Feature
250250
function
251251
New-ContainerTransparentNetwork
252252
{
253+
# Check if transparent network already created
254+
$networkList = docker network ls
255+
if ($networkList -match '\bTransparent\b') {
256+
Write-Output "Network with the name Transparent exists."
257+
return
258+
}
259+
260+
# Continue with network creation
253261
if ($ExternalNetAdapter)
254262
{
255263
$netAdapter = (Get-NetAdapter |? {$_.Name -eq "$ExternalNetAdapter"})[0]

0 commit comments

Comments
 (0)