Hello
I try to create a script with validation input, and condition: if folder exist enter yes to continue the scipt, or quit to return the powershell host command, else if the folder does not exist continue the script.
the break and continue have the same result it continue the script
the scipt
$folderexist=test-path c:\history
if ($Folderexist) {
do{
$input=read-host “folder exist if you want enter Y(y) to continue or Q(q) to quit”
if ($input -match "Q"){
write-host "you choice to quit the script to powershell host"
break
}elseif ($input -match "Y"){write-host "continue script"
}
}
until ($input -match "y|q")
}else{write-host “continue script”}
#continue script
…thé script continuez wish 100 lines