-
-
Notifications
You must be signed in to change notification settings - Fork 912
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
Fix with oscdimg.exe search, ExecutionPolicy, compression, etc.. #319
base: main
Are you sure you want to change the base?
Conversation
- Edit README.md part for `Set-ExecutionPolicy` to use `-Scope Process` to prevent changing the entire computer's policy. - Fix tiny11maker.ps1 and tiny11Coremaker.ps1 to find oscdimg.exe from registry instead of using fixed path. - Add Run.bat helper batch file(referenced from Win11Debloat) to help running tiny11maker with double clicking.
Although it is stated that this project is open-source, it would be nice to add the license(MIT, BSD, Apache 2.0) file as the github document says However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. If you've chosen not to license this project for some reason, I respect that decision 😊. |
- Add AllSigned, Undefined for consideration which also prevent script from running
# Check if PowerShell execution is restricted | ||
if ((Get-ExecutionPolicy) -eq 'Restricted') { | ||
Write-Host "Your current PowerShell Execution Policy is set to Restricted, which prevents scripts from running. Do you want to change it to RemoteSigned? (yes/no)" | ||
# Check if PowerShell execution is Restricted or AllSigned or Undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious if this part is actually called, is this for some possible cases where the user tries to run it from powershell they have been using for different activity which could have set ExecutionPolicy to the value that does not allow script to run? I think in normal cases, the user will run it with from the powershell which have the ExecutionPolicy that allow to run custom scripts, and it is inherited, which make it will never be the ones that need to be changed for elevation.
b6c11dc
to
399cddd
Compare
- fix the cause of crash if ADK is not installed
399cddd
to
e1273fe
Compare
- Get architecture using Get-WindowsImage and its property directly. - Use Get-AppxProvisionedPackage and Remove-AppxProvisionedPackage instead if dism for more consistence. - Use Export-WindowsImage with -CompressionType Maximum instead of Fast for smaller type(used to be recovery with dism.exe).
- align switch block
- Revert to use dism for exporting install.esd to use recovery compression which reduced the size about 1 gigabytes. - Add outlook provisioned appxpackage for removal.
# Compressiontype Recovery is not supported with PShell https://learn.microsoft.com/en-us/powershell/module/dism/export-windowsimage?view=windowsserver2022-ps#-compressiontype | ||
Export-WindowsImage -SourceImagePath $ScratchDisk\tiny11\sources\install.wim -SourceIndex $index -DestinationImagePath $ScratchDisk\tiny11\sources\install2.wim -CompressionType Maximum | ||
# Compressiontype Recovery is not supported with PShell https://learn.microsoft.com/en-us/powershell/module/dism/export-windowsimage?-ps#-compressiontype | ||
& dism /English /Export-Image "/SourceImageFile:$ScratchDisk\tiny11\sources\install.wim" "/SourceIndex:$index" "/DestinationImageFile:$ScratchDisk\tiny11\sources\install.esd" /Compress:recovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From 7ec6a7c, looks like using recovery compression to export wim image worked at some time? Currently when I tested with Window 11 23H2 and it creates garbage file which has nothing at all(this is somehow expected as .esd extension is required for recovery compression(I somehow have an iso file created with tiny11maker.ps1 which has install.wim file compressed with recovery compression(LZMS)(?), so it looks like it used to work previously at some time, which is not guaranteed). Actually tiny11CoreMaker.ps1 currently exports as .esd image, and it boots without issue, so I think keeping using dism is necessary for this part.
- revert packagePrefixed change as the package is already in github.com/ntdevlabs/pull/253
f48d4e0
to
688458d
Compare
- registry value from WOW6432Node is regarded first for setup
Set-ExecutionPolicy
to use-Scope Process
to prevent changing the entire computer's policy.