Skip to content

Conversation

@Miiraak
Copy link
Contributor

@Miiraak Miiraak commented Aug 31, 2025

Purpose :

Some are merge from my old different pr.

Details :

Adding SKU validation (#338)

  • Added validation to ensure the entered index is valid by checking against available indices in the Windows image file.
  • Introduced a loop to repeatedly prompt the user until a valid index is provided.

New parameter and improvement (#333)

  • Updated script parameters to include a new $p_IsoDisk parameter.
  • Renamed $ScratchDisk to $p_ScratchDisk throughout the script.
  • Added logic to handle $p_IsoDisk, prompting user if not provided.
  • Removed output of scratch disk setting.
  • Edit :
    • Parameters renamed to :
      • $ISO
      • $SCRATCH
    • Synopsis added
    • Parameters order inverted

New Functions for registry optimisation (#335)

  • Introduced Remove-RegistryValue and Set-RegistryValue functions to replace direct reg commands for registry modifications.

Taken from my GUI PR optimisation.

Add autounattend.xml download if missing (#305)

  • Implement a check for the existence of autounattend.xml. If the file is not found, download it from a specified URL using Invoke-RestMethod and save it to the script's root directory. This ensures the configuration file is available for the script's execution.

Auto Dismount (#335)

  • Dismounting the iso image after process completion.

Taken from my GUI PR optimisation.

Update PackagesToRemove with new ones

  • Add new packages in $packagePrefixes.
  • Change disposiition of $packagePrefixes to better lisibility.
  • Modify the where-object query param from -like "$_*" to -like "*$_*"

Others



We can add more - Fix if you find some opened issues that are related to these ones.
Reviews are gladly welcome ! Let me know if there is some thing to modify.

PS: I've seen some error related with the registry keys, but im not too familiar with it, seem some key does not existe in my reg but mabye is useful for some windows edition... but noting critical. tiny11iso is fine.

Miiraak and others added 6 commits August 31, 2025 12:27
*merge from my old different pr.

## New parameter and improvement
- Updated script parameters to include a new $p_IsoDisk parameter.
- Renamed $ScratchDisk to $p_ScratchDisk throughout the script.
- Added logic to handle $p_IsoDisk, prompting user if not provided.
- Removed output of scratch disk setting.
- Change the ordre to match iso then scratch
- Rename parameter
- Adding pattern for second one too
- Adding synopsis with some informations on the script and calling exemples.

## New Functions for optimisation
- Introduced Remove-RegistryValue and Set-RegistryValue functions to replace direct reg commands for registry modifications.

## Auto Dismount
- Dismounting the iso image after process completion.

## SKU validation
- Added validation to ensure the entered index is valid by checking against available indices in the Windows image file.
- Introduced a loop to repeatedly prompt the user until a valid index is provided.

## Others
- Updated `.gitignore` to exclude Visual Studio files.
- Revised `README.md` for clarity and added new features.
Implement a check for the existence of `autounattend.xml`. If the file is not found, download it from a specified URL using `Invoke-RestMethod` and save it to the script's root directory. This ensures the configuration file is available for the script's execution.
Updated `tiny11maker.ps1` to replace `Remove-RegistryKey`
with `Remove-RegistryValue` for specific registry values.
Expanded the cleanup section to include detailed checks
and messages for the existence and removal of temporary
files and directories, improving script robustness and
user feedback.
- Add new packages in `$packagePrefixes`.
- Change disposiition of `$packagePrefixes` to better lisibility.
- Modify the `where-object` query param from `-like "$_*"` to `-like "*$_*"`
@Miiraak
Copy link
Contributor Author

Miiraak commented Aug 31, 2025

I've forgot

Enhance cleanup process

  • Expanded the cleanup section to include detailed checks
    and messages for the existence and removal of temporary
    files and directories.

inclue autounattend.xml and oscdimg.exe

@Miiraak
Copy link
Contributor Author

Miiraak commented Aug 31, 2025

Summary of PSScriptAnalyzer Errors and Warnings

1. PSUseShouldProcessForStateChangingFunctions

Type: Warning
Affected functions:

  • Set-RegistryValue — Line 46
  • Remove-RegistryValue — Line 61
    Message: The function should support ShouldProcess as it changes system state.

2. PSAvoidUsingWriteHost

Type: Warning
Usage of Write-Host is discouraged in:
Lines: 76, 81, 94, 111, 131, 134, 135, 138, 139, 144, 148, 151, 157, 174, 176, 189, 195, 198, 267, 279, 289, 292, 297, 301, 304, 310, 321, 351, 354, 356, 358, 361, 364, 366, 378, 468, 474, 475, 478, 480, 484, 486, 489, 491, 492, 501, 503, 504, 505, 507, 512, 515, 521, 527, 538, 539, 549, 552, 553, 555, 560, 563, 568, 572, 578, 587, 589
Message: Prefer Write-Output, Write-Verbose, or Write-Information for better compatibility.


3. PSAvoidUsingPositionalParameters

Type: Information
Calls to Set-RegistryValue with positional parameters in:
Lines: 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 349, 350, 355, 357, 359, 360, 365, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 379, 380, 381, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537
Message: Use named parameters for clarity and robustness.


4. PSAvoidTrailingWhitespace

Type: Information
Trailing whitespace detected at:
Lines: 6, 9, 10, 107, 159, 207, 254, 409, 415, 427, 516, 564
Message: Remove unnecessary trailing whitespace at the end of these lines.


5. PSAvoidUsingEmptyCatchBlock

Type: Warning
Empty catch block found at:
Line: 163
Message: Use Write-Error or throw statements in catch blocks for better error management.


- Fix `PSAvoidTrailingWhitespace`
- Fix `PSAvoidUsingWriteHost`
- Fix `PSAvoidUsingEmptyCatchBlock`
- Fix `PSUseShouldProcessForStateChangingFunctions`
> False positive, it does not touch the running system registry.

For `PSAvoidUsingPositionalParameters` i can add named parameters but it's not mandatory if positional is repected.
@Miiraak
Copy link
Contributor Author

Miiraak commented Aug 31, 2025

Fixes for PSScriptAnalysis report

  • Fix PSAvoidTrailingWhitespace
  • Fix PSAvoidUsingWriteHost
  • Fix PSAvoidUsingEmptyCatchBlock
  • Fix PSUseShouldProcessForStateChangingFunctions
    • False positive, it does not touch the running system registry.

For PSAvoidUsingPositionalParameters i can add named parameters but it's not mandatory if position is respected.

@Miiraak Miiraak changed the title Update documentation and multi enhance tiny11maker script Update documentation and merged fixes Aug 31, 2025
@Miiraak
Copy link
Contributor Author

Miiraak commented Sep 6, 2025

Conflict resolution (ecd3c83)

@ntdevlabs ntdevlabs merged commit bde07ab into ntdevlabs:main Sep 6, 2025
@Miiraak Miiraak deleted the Merged-PR-tiny11maker.ps1 branch September 6, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants