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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 2E: Create a program named FileComparison that compares two files. First, use a text editor such as...
icon
Related questions
Question

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

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT