Posts

Showing posts with the label Exporting files

DAY-4: PowerShell Pipeline and Exporting Data

Image
Pipeline - Connecting commands   PowerShell connects commands to each other using something called a Pipeline. The pipeline provides a way for one command to pass, or pipe, its output to another command, allowing that second command to have something to work with. The concept of joining commands is not limited to PowerShell, but PowerShell takes the same piping to a greater extend for better effect.  Exporting Output to Files 1. Get-Process 2. Get-service When we run above commands, a table with several columns of information appears on the screen.  It's great to have information on the screen, but that isn't all you might want to do with the information. For example, if you want to export the information into a CSV file that could be read into an application like Microsoft excel.  Exporting to CSV Exporting to a file is where the pipeline and a second command come in handy. Get-Process | Export-csv C:\procs...