Skip to content

Commit

Permalink
Create destroy.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey authored Nov 21, 2018
1 parent 900d1d8 commit 98f4768
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/windows/destroy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

foreach($line in Get-Content ./common.cmd) {
[Environment]::SetEnvironmentVariable($line.split('=')[0], $line.split('=')[1], "Process")
}
$fullimagename = $($env:maintainer) + '/' + $($env:imagename)

$result = docker ps -a | grep $($fullimagename) | awk '{print $1}'

if ( $result ) {
docker rm -f $(docker ps -a | grep $($fullimagename) | awk '{print $1}')
docker rmi -f $($fullimagename)
echo "container/image removed..."
} else {
echo "no container/image found..."
}

0 comments on commit 98f4768

Please sign in to comment.