Computer Science Hello I have a Powershell question but my answer doesn't seem to work. The answer columns are where the blank contents are supposed to be filled Before you begin, create a new text file located in C:\MyTextFile.txt, add ten lines of text to it, and save the file. Complete the PowerShell script below by filling-in the missing information so that the script will satisfy the following requirements: Read the contents of the text file you created earlier. Using a while loop, display each line of text one line at a time in the console window. Solution Clear-Host Answer = Answer Answer = Answer Content -Path 'C:\MyTextFile.txt' Answer ( $lineNumber Answer le $fileContents.length ) { Answer line = $fileContents[ Answer ] Write-Host "Line $lineNumber Contents: Answer " $ Answer + } This is what I have so far for my answer Clear-Host $lineNumber = 0 $fileText = Get-Content -Path 'C:\MyTextFile.txt' while ( $lineNumber -le $fileContents.length) { write-line = $fileContents[$lineNumber
Computer Science
Hello I have a Powershell question but my answer doesn't seem to work. The answer columns are where the blank contents are supposed to be filled
Before you begin, create a new text file located in C:\MyTextFile.txt, add ten lines of text to it, and save the file.
Complete the PowerShell script below by filling-in the missing information so that the script will satisfy the following requirements:
Read the contents of the text file you created earlier.
Using a while loop, display each line of text one line at a time in the console window.
Solution Clear-Host Answer = Answer Answer = Answer Content -Path 'C:\MyTextFile.txt' Answer ( $lineNumber Answer le $fileContents.length ) { Answer line = $fileContents[ Answer ] Write-Host "Line $lineNumber Contents: Answer " $ Answer + }
This is what I have so far for my answer
Clear-Host
$lineNumber = 0
$fileText = Get-Content -Path
'C:\MyTextFile.txt'
while ( $lineNumber -le
$fileContents.length)
{
write-line = $fileContents[$lineNumber
Step by step
Solved in 3 steps with 2 images