Skip to Main Content
Learn PowerShell Core 6.0
book

Learn PowerShell Core 6.0

by David das Neves, Jan-Hendrik Peters
July 2018
Beginner content levelBeginner
552 pages
13h 18m
English
Packt Publishing
Content preview from Learn PowerShell Core 6.0

Files

Another area where you should become very confident is working with files, as you will need to work with them very frequently. First, we will take a look at the basics of working with files by retrieving and writing files and the content of the files. This can be achieved with the Get-Content and Set-Content/Out-File cmdlets.

First of all, we will take a dedicated look at how you can export content to a file:

#Storing working location$exportedProcessesPath = 'C:\temp\exportedProcesses.txt'#Write processes table to file and show the result in Terminal with the -PassThru flagGet-Process | Set-Content -Path $exportedProcessesPath #Open file to verifypsedit $exportedProcessesPath#retrieving processes and exporting them to fileGet-Process ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PowerShell and WMI

PowerShell and WMI

Richard Siddaway

Publisher Resources

ISBN: 9781788838986Supplemental Content