Posts

Showing posts with the label Windows PowerShell

DAY 8 - Advance Pipeline

Image
At this, point you've learned to pretty effective with PowerShell's Pipeline. Running Pipeline commands is powerful, accomplishing in one line what used to take several lines of the script. But if I said you can even do better than this, in this blog we'll dig deep into the pipeline and discover its powerful capabilities.  How PowerShell Passes Data Down to Pipeline Whenever you string two commands in a pipeline, PowerShell has to figure out how to get the output of the first command to the input of the second command. Let say the first command as command A and the second command as command B. A will produce something and B, which needs to accept A's output as input and then do its own thing. Command A | Command B For example, suppose you have a text file that contains one computer name on each line. You might want to use those names as the input to some command, telling that command which computers you want to run against. Get-cont...

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...

DAY-1 : POWERSHELL…WHAT IT IS>>>AND WHY

Image
    POWERSHELL …WHAT IT IS>>>AND WHY                                                                                                                                                                                                                                        ANKIT SHARMA For normal computer users it is a useless…..but listen, for an IT administrators it is a great standard comm...