I’m trying to do a script using the “while” command with two conditions, the second condition is to stop the script when I type “end”. I cannot do it.
$semester = Read-Host -Prompt ‘Input Semester Name’
md $semester
Set-Location $semester
while(($courseID = Read-Host -Prompt ‘Input Course Name, type end when finished’) $courseID -ne
"end"{
md $courseID
cd $courseID
md “Assignments”
md “Notes”
cd ..
}
endwhile
cd ..
tree $semester
Write-Host “All Done, See you next semester”