File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ switch ($true) {
2828 if (-not (Get-AppxPackage * WindowsSubsystemForLinux* | Remove-AppxPackage - ErrorAction SilentlyContinue 2> $null )) {
2929 Disable-WindowsOptionalFeature - Online - FeatureName Microsoft- Windows- Subsystem- Linux - ErrorAction SilentlyContinue 2> $null
3030 }
31+ $containersJson = & hcsdiag list - raw
32+ $containers = $containersJson | ConvertFrom-Json
33+ $containerGuids = $containers | ForEach-Object { $_.Id }
34+ foreach ($containerGuid in $containerGuids ) {
35+ & hcsdiag kill $containerGuid
36+ }
3137 wsl.exe -- install -- no- launch -- no- distribution
3238 Write-Host " WSL has been shutdown and re-installed."
3339 }
@@ -48,6 +54,12 @@ switch ($true) {
4854 if (-not (Get-AppxPackage * WindowsSubsystemForLinux* | Remove-AppxPackage - ErrorAction SilentlyContinue 2> $null )) {
4955 Disable-WindowsOptionalFeature - Online - FeatureName Microsoft- Windows- Subsystem- Linux - ErrorAction SilentlyContinue 2> $null
5056 }
57+ $containersJson = & hcsdiag list - raw
58+ $containers = $containersJson | ConvertFrom-Json
59+ $containerGuids = $containers | ForEach-Object { $_.Id }
60+ foreach ($containerGuid in $containerGuids ) {
61+ & hcsdiag kill $containerGuid
62+ }
5163 wsl.exe -- install -- no- launch -- no- distribution
5264 Write-Host " WSL has been shutdown, all distros unregistered, and WSL has been re-installed."
5365 }
You can’t perform that action at this time.
0 commit comments