Skip to content

Commit

Permalink
Readme update with v4 examples. typos
Browse files Browse the repository at this point in the history
  • Loading branch information
okibcn committed Jan 31, 2023
1 parent 5a51f89 commit e48534d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ The usage is straightforward:
the utility ensures a minimal size and you end up with contiguous files for faster access in old HD-based systems. Should you need the list of names of your distros, it is accessible by typing `wsl -l`.

```
Usage: wslcompact [OPTIONS] [DISTROS]
Usage: wslcompact [OPTIONS] [DISTROS]
wslcompact compacts the images of WSL distros by removing unsused space.
If no option is provided, it will default to info mode, without modifying any image.
If no distro is provided it will process all the installed images.
NOTE: WSL will be shutdown for compacting the images.
Options:
no opt. Provides name, image file path, current size, and estimated new size information.
-c Compacting mode: process the selected distros compacting the images.
-y replaces selected images without asking for confirmation.
-d Enable the processing of data images. Default is disabled.
-y Perform actions without asking for confirmation.
-h Prints this help
Examples:
Expand Down Expand Up @@ -117,8 +118,11 @@ PS> wslcompact -c -y Ubuntu
Current size: 12864 MB
Estimated size: 7700 ± 188 MB
The estimated process time using an SSD is about 2 minutes.
NOTE: You can safely cancel at any time by pressing Ctrl-C
Import in progress, this may take a few minutes.
The operation completed successfully.
Compacted from 12864 MB to 7728 MB
New Image compacted from 12864 MB to 7728 MB
Do you want to apply changes and use the new image (y/N): y
Image replaced for distro: Ubuntu
```

3 changes: 2 additions & 1 deletion wslcompact.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss\`{* | ForEach
wsl --unregister wslclean | Out-Null
$size2 = (Get-Item -Path "$tmp_folder/$wsl_distro.vhdx").Length / 1MB
Write-Host " New Image compacted from $size1 MB to $size2 MB"
$answer = if ($force) { 'y' } else { read-host -prompt "Do you want to apply changes and use the new image (y/N)" }
$answer = if ($force) { 'y' } else { read-host -prompt " Do you want to apply changes and use the new image (y/N)" }
if ($answer -match 'y') {
Move-Item "$tmp_folder/$wsl_distro.vhdx" "$wsl_path/ext4.vhdx" -Force
Write-Host " Image replaced for distro: $wsl_distro"
}
}
else {
Expand Down

0 comments on commit e48534d

Please sign in to comment.