On a side note, in PowerShell 3.0 you can use the Get-Content
cmdlet with the new Raw switch:
$text = Get-Content .\file.txt -Raw
More Related Contents:
- Powershell script to delete 15 days old .txt files [duplicate]
- How to run an EXE file in PowerShell with parameters with spaces and quotes
- Use PowerShell to run virus scan on multiple servers
- Unable to access UNC Paths in Powershell remote session
- Fastest Way to get a uniquely index item from the property of an array
- PowerShell IE9 ComObject has all null properties after navigating to webpage
- PowerShell script to check an application that’s locking a file?
- PowerShell script runs when pasted into the PowerShell window, but not when run from shortcut
- Lambda Expression in Powershell
- PowerShell’s Invoke-RestMethod equivalent of curl -u (Basic Authentication)
- Remove files and foldes on Azure before a new deploy from VSTS
- PowerShell: Unable to find type when using PS 5 classes
- Pass object[] into a function in PowerShell
- Inserting a date into SQL
- Prompt for user input in PowerShell
- PowerShell – get process ID of called application
- Delete all files and folders but exclude a subfolder
- Can the following Nested foreach loop be simplified in PowerShell?
- Add Write-Progress to Get-Job/Wait-Job
- Powershell with exchange– How do I append all verbose output to a file
- How to handle command-line arguments in PowerShell
- How to send email with PowerShell
- How to split string by string in Powershell
- Powershell: Colon in commandlet parameters
- Passing PowerShell variables into a script block
- Why is $false -eq “” true?
- How to run powershell command in batch file
- Is there a PowerShell equivalent of `paste` (i.e., horizontal file concatenation)? [duplicate]
- Getting “Can’t find the drive. The drive called ‘IIS’ does not exist.”
- Prevent trailing newline in PowerShell Out-File command