You can use PowerShell here-string operator (@) to achieve cat EOF in PowerShell. Let me explain with an example –
Write something into a file including special characters
1 2 3 4 5 6 7 8 9 |
## Write something into a file echo @' This is some demo content that contains special charedcters like !@$%^&()):"{}][;'] '@ > myscript.txt ## Get the content Get-Content -Path .\myscript.txt |
Write something into a file with substitution
1 2 3 4 5 6 7 8 9 |
## Write something into a file $name = "debjeet" echo @" Hello everyone This is $name "@ > myscript.txt ## Get the content Get-Content -Path .\myscript.txt |