The PowerShell pipeline can pass objects from one command to another, enabling output from a function to stream – or ‘pipe’ – as input into another command. In this article we will demonstrate how to leverage this functionality to seamlessly…
Read More
Download Invoke-ActiveScript wrapper and demos
It’s quite possible to run traditional WSH script from the PowerShell console, and people have even directly hosted VBScript in PowerShell since 2004 using the Microsoft Script Control. However, you can go farther than just…
Read More
The other day I was involved in a short Twitter debate about the relative merits of using Return vs Write-Object (or its alias Write) in PowerShell functions. Here’s my take.
I treat Return as a legacy keyword. You may have…
Read More
A while ago I published a short function to create CSV strings. While working on another task I came across $OFS, which is something I know about but never really think about. $OFS is an intrinsic PowerShell variable that controls…
Read More
One drawback to the service objects returned from Get-Service is that you can’t see what account the service is running under, often referred to as the service account. This will be something like LocalService or perhaps even a special user…
Read More
Of course since I’ve posted a VBScript version of the Tree command, I had to do it in PowerShell. On one hand, this would have been pretty straightforward since PowerShell can use COM objects and I could have simply reused…
Read More
My latest Prof. PowerShell column has a function that takes a computername as pipelined input. It then returns a custom object showing free space on drive C:\. The point of the column was to demonstrate how to make a function…
Read More