John_Dodo
Dec 07, 2022Brass Contributor
exit powershell scriptS when imbricated
Hello,
I have a script main.ps1 called with parameters "-environment PRD" or "-environment "PILOT".
This main script calls a toolbox.ps1 script which is like this :
switch ($environment) {
"PILOT" {
#define PILOT vars
}
"PRD" {
#define PRD vars
}
default {
write-host "!!! No Environment provided !! Closing the script."
exit
}
}
This exit seems to only close the toolbox.ps1 script but not the main.ps1
How can I achieve this ?
Thank you.