nav-arm-templates/RemoveDockerEngine.ps1

22 строки
751 B
PowerShell
Исходник Постоянная ссылка Обычный вид История

2021-10-24 00:46:05 +03:00
# Stop and Remove docker service
2021-11-05 13:00:54 +03:00
$dockerService = get-service docker -ErrorAction SilentlyContinue
if ($dockerService) {
if ($dockerService.Status -eq "Running") {
2021-10-24 00:46:05 +03:00
Stop-Service docker
}
2021-11-05 13:00:54 +03:00
Set-Location "c:\program files\docker"
.\dockerd.exe --unregister-service
2021-10-24 00:46:05 +03:00
}
2021-10-31 11:58:49 +03:00
$path = [System.Environment]::GetEnvironmentVariable("Path", "User")
2021-10-31 12:08:02 +03:00
if (";$path;" -like "*;$($env:ProgramFiles)\docker;*") {
[Environment]::SetEnvironmentVariable("Path", ("$path;" -replace ";C:\\Program files\\docker;", ";"), [System.EnvironmentVariableTarget]::User)
2021-10-31 11:58:49 +03:00
}
2021-10-24 00:46:05 +03:00
# Remove installation folder
2021-11-05 13:00:54 +03:00
Set-Location c:\
2021-10-24 00:46:05 +03:00
Remove-Item -path $env:ProgramFiles\docker -Recurse -Force
# Remove docker in ProgramData
# Remove docker data-root