tiny11builder icon indicating copy to clipboard operation
tiny11builder copied to clipboard

variabile scratchdisk

Open elvisquaglia opened this issue 10 months ago • 9 comments

hi, when I open the file in powershell it gives me this error, then I try to open it again with admin privileges but the shell closes immediately

Image

elvisquaglia avatar Feb 14 '25 16:02 elvisquaglia

Hello! You must mount your iso and then choose the letter that has been assigned to it.

Plus, if you want to keep the console open,

cd c:\path\to\the\folder\containing\the\script

Then start the script

.\tiny11maker.ps1

Miiraak avatar Feb 14 '25 18:02 Miiraak

@Miiraak

How can setup via parameter the value for "ValidatePattern" and "ScrtachDisk"

See .ps1 sourfce code

param ( [ValidatePattern('^[c-zC-Z]$')] [string]$ScratchDisk )

Could be interesting for automatic batch. Example

powershell -file Tinymaker.ps1 param1 param2

where

param1 = disk letter param2 = script folder

bovirus avatar Feb 14 '25 20:02 bovirus

thank you

elvisquaglia avatar Feb 14 '25 21:02 elvisquaglia

Hi @bovirus You can still do

.\tiny11maker.ps1 A

but as it this is the same as doing it without the param.

Cause is this :

if (-not $ScratchDisk) {
    $ScratchDisk = $PSScriptRoot -replace '[\\]+$', ''
} else {
    $ScratchDisk = $ScratchDisk + ":"
}

$ScratchDisk = $ScratchDisk + ":" don't change the value of $ScratchDisk so he use the root folder of the script.

But, it's not a bad idea, so i've made a pr with your request don't know if it will be added 🤔 You can take a look here or wait for merging 👍🏼



@elvisquaglia ur welcome ! 😸

Miiraak avatar Feb 15 '25 00:02 Miiraak

@Miiraak

Thanks for updated script.

EWhats the difference in

param1 : Letter of the choosen drive param2 : Letter of the mounted .iso

What's param1? What's chosen drive? Example if I mounted the iso as I drive what'sthe settings?

bovirus avatar Feb 15 '25 09:02 bovirus

@bovirus No problem, i hope that can help and improve that superb script ;)

The difference between the two parameters

Parameters Desc :
param1 Represent the scratch location drive letter. This is the folder the script use to make copy and modification on the iso files. That can be whatever disk you want.
param2 Represent the mounted .iso drive letter that automaticaly given to it.

Imagine you want to use your local disk D as working directory for the script and your mounted iso is on E. You can do :

.\tiny11maker.ps1 D E

So tiny11 will create the log and folder on D:/tiny11/source/ and will copy the content of E: on it to make the modification.

After that you have a last interaction with the script to choose the index but as there is a lot of differents iso i think its better to let this as it.

Miiraak avatar Feb 15 '25 11:02 Miiraak

@Miiraak

Thanks for explanation.

Do you think that it's possible to add the explanation for param1/param2 as comment in the header of the script? I believe that can help to understand the use of param1 and param2

For use of teh script in a batch I believe that could be better to have param1 for unit to mount iso file and param2 for curent unit for temporary file

if you don't specifcy param1 ask in the script what's the unit for mount iso file

If you don't specfy param2 you can get as default the unit where are you running the script.

bovirus avatar Feb 15 '25 13:02 bovirus

@bovirus Yeah i can take a look for adding that and maybe smtg like :

.\tiny11maker.ps1 -Iso E -Scratch D 

I will modify params order soon

The case No parameters is already handle, if you don't specify iso it will ask you. And for scratch it choose the script folder destination to create the folder and log.

Miiraak avatar Feb 15 '25 15:02 Miiraak

@bovirus Done ! You can check new modification #333 Script still on my fork 👾

Miiraak avatar Feb 16 '25 10:02 Miiraak