[BUG] Mo optimize for Win11
Describe the bug
⚙ System 10.1/31.9GB RAM | 426/465GB Disk | Uptime 0.2d
➤ Disk Optimization Get-Partition : Aucun objet MSFT_Partition avec la propriété «DriveLetter» égale à «C» n’a été trouvé. Vérifiez la valeur de la propriété et réessayez. Au caractère C:\Users\Arnaud\AppData\Local\Mole\bin\optimize.ps1:147 : 24
-
... $diskNumber = (Get-Partition -DriveLetter $env:SystemDrive[0]).DiskNu ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : ObjectNotFound: (C:Char) [Get-Partition], CimJobException
- FullyQualifiedErrorId : CmdletizationQuery_NotFound_DriveLetter,Get-Partition
☻ Disk optimization failed: La propriété « DiskNumber » est introuvable dans cet objet. Vérifiez qu’elle existe.
➤ DNS Cache ✓ DNS cache flushed
A clear and concise description of what the bug is. We suggest using English for better global understanding.
Steps to reproduce
- Run command:
mo ... - ...
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Debug logs
Please run the command with --debug flag and paste the output here:
mo <command> --debug
# Example: mo clean --debug
Debug output
Paste the debug output here
Environment
Please run mo update to ensure you are on the latest version, then paste the output of mo --version below:
Paste mo --version output here
Additional context
Add any other context about the problem here, such as screenshots or related issues.
@Shepard33 This is fixed on the windows branch.
The problem was the extra disk lookup before optimize started. That lookup is flaky on some Windows 11 setups.
Please refresh and run mo optimize again. If it still breaks, send mo optimize --debug and I will continue from there.