Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tiny11maker.ps1 - use dism with PowerShell commands / QoL improvements #268

Merged
merged 7 commits into from
Nov 17, 2024

Conversation

Karl-WE
Copy link
Contributor

@Karl-WE Karl-WE commented Nov 6, 2024

The idea of the release of this project is using PowerShell instead of commandline in the previous version, which is a great move and make it easier to maintain and read.

For sake of easier syntax and readability I have attempted using PowerShell commandlets for dism.

There are few remaining areas that need to be reworked (invoking dism.exe) to become fully consistent.

CommandType Name Version Source
Cmdlet Add-WindowsImage 3.0 Dism
Cmdlet Dismount-WindowsImage 3.0 Dism
Cmdlet Expand-WindowsImage 3.0 Dism
Cmdlet Export-WindowsImage 3.0 Dism
Cmdlet Get-WindowsImage 3.0 Dism
Cmdlet Mount-WindowsImage 3.0 Dism
Cmdlet New-WindowsImage 3.0 Dism
Cmdlet Optimize-WindowsImage 3.0 Dism
Cmdlet Remove-WindowsImage 3.0 Dism
Cmdlet Repair-WindowsImage 3.0 Dism
Cmdlet Save-WindowsImage 3.0 Dism
Cmdlet Split-WindowsImage 3.0 Dism

The idea of the release of this project is using PowerShell instead of commandline in the previous version, which is a great move and make it easier to maintain and read.

For sake of easier syntax and readability I have attempted using PowerShell commandlets for dism.


There are few remaining areas that need to be reworked (invoking dism.exe) to become fully consistent.
small corrections
typo -ScratchDirectory
fixed typo -ScratchDirectory (2)
@Karl-WE Karl-WE mentioned this pull request Nov 7, 2024
error handling for param as we will later make the script agnostic to execution on OSDrive / $env:systemdrive
last corrections 
- to replace wrong command -ScratchDirectory with -Path
- putting param to the top
- make sure $Scratchdisk is $PSScriptRoot remove :\ or trailing \
- param will now have error handling for drive letters c-z and C-Z
- all references to $env:systemdrive or $($env:systemdrive) now generalized to $ScratchDisk


- tested the modified script and review log for errors
@Karl-WE
Copy link
Contributor Author

Karl-WE commented Nov 7, 2024

solved items:

open issues:

  • the $Scratchdirectory is missing driveletter: and path when executed by Explorer context menu.

@Karl-WE Karl-WE changed the title Update tiny11maker.ps1 - use dism with PowerShell commands Update tiny11maker.ps1 - use dism with PowerShell commands / QoL improvements Nov 7, 2024
@Karl-WE
Copy link
Contributor Author

Karl-WE commented Nov 7, 2024

This all took some serious time for testing, Hope you can review and merge @ntdevlabs . Thanks for keeping up this great helper!

@Xenshen
Copy link

Xenshen commented Nov 7, 2024

@Karl-WE

I hope you're doing well. I wanted to thank you again for your guidance. I'm still fairly new to working with software at this level, and I'm following your instructions closely. However, I'm still encountering some errors, specifically DISM errors and "Package Unknown" issues when attempting to remove bloatware.

I was wondering if taking ownership of the "Tiny 11" folder might help resolve this. Could you confirm if that’s something I should try?

Additionally, when I execute the command for the unrestricted policy and select "Yes" to all, I don’t receive any confirmation— it just drops to a blank line. Is this the expected behavior? Or is there a command I can use to check the current status of the policy?

Lastly, I’m currently using a modified version of Tiny 11 that was created by another user. Unfortunately, it won’t activate, and the system performance is quite poor.

Thank you in advance for your assistance. I look forward to your feedback.

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Nov 7, 2024

Quite complex to help you here remotely @Xenshen .

I can only support you with the official Version or my one written yesterday

@Xenshen
Copy link

Xenshen commented Nov 7, 2024

Quite complex to help you here remotely @Xenshen .

I can only support you with the official Version or my one written yesterday

I am using the official version; I think you are misunderstanding. I'm not asking help for the Jank build I need help with the official it's just not working. This time it made an ISO that was 14gbs and nothing removed the attachment I sent was the errors from the official build.

I'd gladly try yours do you have a link and or zip file.

@ntdevlabs ntdevlabs merged commit 71e1e30 into ntdevlabs:main Nov 17, 2024
@15w34r0n3D4y
Copy link

  • the script is no longer depending on drive c see also only works on C: #196 - only the dism scratch dir is created in OS drive dynamically but all other operations are on the PSScriptRoot, with launch from console execution

But how change it? Because I won't scratch or tiny11 dir on C: partition (low disk space), I want it on D partition. Thank you for answer.

@Karl-WE
Copy link
Contributor Author

Karl-WE commented Nov 21, 2024

The tiny11 dir will be where you execute the script via PowerShell in Microsoft Terminal.

The scratch dir is C. Changing this would require quite some effort.

We would need to specify a new param and depending on this being Set with a valid value we can specify scratch dir in Dism /PowerShell Dism commands.

Again that's a quite complex change that requires a lot of error handling and change to the code.

I leave it to
@ntdevlabs

#offtopic
As a Windows Insider and MVP my General suggestion is that everyone should keep 5-10 GB free on drive C.

No longer for Windows Updates, except you disabled Windows Reserved Space Feature or coming from an old install.

Please consider the following:

  • install Microsoft PC Manager
    It will cleanup stuff most sufficiently, compared to legacy Microsoft Cleanmgr or Settings app
  • use PC Manager to find large files
  • use OneDrive with Files on Demand
  • when using OneDrive already check to enable more folders it now supports music and video folders
  • settings app > system > storage > enable storage sense on a weekly basis for download, OneDrive, etc.
  • settings app > system > storage > click on temp files
  • settings app > system > applications > move uwp Apps to a different drive
  • in Windows 11 24H2 leverage disable unused uwp Apps Feature or remove them via settings > Apps
  • Disable System Protection and purge on drive C. This feature has overlived it's use case
  • disable hibernation if feasible saves some Gigabytes
  • do not delete the WinRE partition. You might want to remove OEM recovery Partition and expand C in settings > storage > adv options > disk and volumes

Last resort:

  • use treesizeview free and cleanup your sh** :)
  • use wureset.com and easily cleanup winsxs reset base) and Windows Update Cache (you can delete Windows\Softwaredistribution.old

Very last ressort (cost / sustainability impact):

  • Get a larger drive for OS and clone existing with Macrium Reflect 8 free.

@15w34r0n3D4y
Copy link

When I run script from D partition it still create tiny11 folder on C partition and 5-10 GB free on drive C is not enough because only scratch dir use more than 10GB...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants