Print in screen

Print preference


Write into file

## Output
# This is the test.

Write-Output "This is the test." | Out-File -FilePath "./test.txt"

cat ./test.txt

Get Conents

$myObject = Get-Content -Path "test.txt"

$myObject

other

$reader = New-Object -TypeName System.IO.StreamReader -ArgumentList "test.txt"

# $reader.ReadLine()

while ($read = $reader.ReadLine()) {
  $read
}