Skip to content

Instantly share code, notes, and snippets.

View AndersHogqvist's full-sized avatar

Anders H AndersHogqvist

View GitHub Profile
@AndersHogqvist
AndersHogqvist / DockerSwitch.ps1
Created May 20, 2024 13:42
DockerSwitch - a ps1 script to switch between Linux and Windows containers
$ServiceDisplayName = "Docker Desktop Service"
# Stop all Docker processes
Stop-Process -Name *docker* -Force 2>$null
# Stop Docker Desktop Service and make sure it's stopped before continuing
$dockerService = Get-Service -DisplayName $ServiceDisplayName
while ($dockerService.Status -eq "Running") {
$dockerService = Get-Service -DisplayName $ServiceDisplayName