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

variabile scratchdisk #332

Open
elvisquaglia opened this issue Feb 14, 2025 · 9 comments · May be fixed by #333
Open

variabile scratchdisk #332

elvisquaglia opened this issue Feb 14, 2025 · 9 comments · May be fixed by #333

Comments

@elvisquaglia
Copy link

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

@Miiraak
Copy link

Miiraak commented Feb 14, 2025

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

@bovirus
Copy link

bovirus commented Feb 14, 2025

@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

@elvisquaglia
Copy link
Author

thank you

@Miiraak Miiraak linked a pull request Feb 15, 2025 that will close this issue
@Miiraak
Copy link

Miiraak commented Feb 15, 2025

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 ! 😸

@bovirus
Copy link

bovirus commented Feb 15, 2025

@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?

@Miiraak
Copy link

Miiraak commented Feb 15, 2025

@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.

@bovirus
Copy link

bovirus commented Feb 15, 2025

@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.

@Miiraak
Copy link

Miiraak commented Feb 15, 2025

@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
Copy link

Miiraak commented Feb 16, 2025

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

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 a pull request may close this issue.

3 participants