Powershell Tip - How to show 2 consecutive write-host results in same line
Hi All!
When we perform some adminitration activities in powershell and would like to see result at the time of execution, we use Write-Host
Typically write-host prints the result and sends cursor to the next line.
Consider a scenario where your perform some operations via powershell and want to print the result of 2 consective write-host in the same line. How can we override the nature behaviour of rite-host? Is there any way?
Here is an example scenario
......write-host $result1
$opr = object;
......
......
......
write-host $result1
Now I want the output of $result1 and $results should be in the same line.
Have a look into the below image where we have accomplish the task using nonewline
Comments
Post a Comment