Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The homework is in powershell script, i have to make a menu that takes input from the user and makes a file, if the user
The homework is in powershell script, i have to make a menu that takes input from the user and makes a file, if the user inputs 2, 3 or bigger number, then makes multiple files like file file1 file2....., I made the program but cant fix the loop to make multiple files, how i will make the loop make multiple files ????
$filename = Read-Host "Name File" $desti Read-Host "File Path" $number = Read-Host "Number of files" 5 6 7 8 9 10 11 for ($number -lt Snumber; $number++){ if( $number -ge "1" ) { New-Item -Path $desti -Name $filename$number -ItemType "file"} elseif ($number -eq "0") {Write-Host "You must select at least one file to be created"} elseif ($number -gt "0" ) {New-Item -Path $desti -Name $filename ItemType "file"} else {pauseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started