SAPIEN Technologies

PowerShell Functions: Return vs Write

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

Out-CSV Revised

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

Get ServiceAccount Name with ADSI

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

PowerShell Tree

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

Show-CSpace

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

RSS SAPIEN Info Center

Search the Archives

Join our mailing list

Enter your email address to subscribe to our mailing lists for Monthly Blog Digests, Product Announcements and more (you can choose which you receive once you sign-up!)

Tags

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2,296 other subscribers

Categories

Archives

Information

Dashboard