Tag powershell

Remoting in PowerShell

PowerShell truly becomes powerful when it is made to handle tasks remotely. While this is amazing, stakeholders in many organisations may be opposed to the idea of remotely managing computers using PowerShell. In most cases, security is the elephant in the room. However, PowerShell is not some super-tool that increases your access within the environment; it just makes tasks easier by eliminating the unnecessary parts that you may have to deal with, if you were graphically performing the tasks.

Understanding streams in PowerShell

In the past, we have spoken about how cmdlets output objects, and how output can be piped from one cmdlet to another. If you ever encountered errors or warnings or verbose output in the execution that involved outputting content to a file, these errors, warnings, verbose outputs… none of them is passed through the pipe into, say, the export cmdlet. Ever wondered why? Enter: Streams Output redirection Out-Host Read-Host The Information stream Redirecting output across streams Wrapping up I speak about the nature of output in PowerShell, in my book:

Piping Commands in PowerShell

We used the pipeline in our past posts. However, we did look into what they are and what they do. If you have had experience with Linux (or Bash in general), there is a good chance you know that the pipeline simply passes the output of a certain command to the command to its right. In this article, we discuss all about pipelines: Understanding the pipeline Using the pipeline to select properties Filtering the output based on a parameter How PowerShell outputs content Formatting the output Only in the end Wrapping up Understanding the pipeline Metaphorically speaking, think of a cmdlet as a machine.

Basics of Cmdlets

Cmdlets are at the core of PowerShell. As already noted in The object-oriented model, a cmdlet is a specialised .NET object, with output formatting that makes sense to an administrator. In this article, we discuss the following: Getting help information for a cmdlet Parameter sets Positional parameters Help on specific parameters Assigning values to a parameter Getting help information for a cmdlet Let us pick a common cmdlet: Get-ChildItem, a simple, useful cmdlet.

The object-oriented model

The moment someone mentions PowerShell or talks about its benefits, one of the first things that comes to people’s minds is how the output is an object. And most of us don’t understand why this should be a big deal that it is made out to be. Or what it even means. I’ve been there, and it took me some time to fully understand its importance. In this article, we talk about: