I am writing a script that will at some point display the output(Around 20 lines) of a command to the console. To maintain the formatting with rest of my script output, i want the Output of the command to be indented a bit to the left. I tried to use a Write-host with some manual spaces, and -NoNewLine, followed by the output of my command, but it only adds spaces to the first line of the output and rest of the lines still appear from the position 0.
Can anyone please help me out with clues here.
Sample Code:
Write-Host " " -NoNewLine
D:\Opatch\patch.bat apply 124423.zip | Write-Host