Posts Tagged ‘Add-Member’
I'm very happy to see more and more people getting their hands dirty with Windows PowerShell. A common challenge I see across different support forums is getting information from one part of a script to another. Very often the user has created a function and is attempting to use its output elsewhere in their script. Often I can tell the scripter is coming from a VBScript background or at least thinking that way. There's nothing necessarily wrong with writing a PowerShell script in a VBScript style, but these scripts are missing out. Let me walk you through several iterations of a function to demonstrate.   More »
Get Local Member
Thursday, April 9th, 2009 by Jeffery Hicks
I've been dealing with the topic of enumerating local group membership in several PowerShell forums from different people. My responses have pretty much been the same. But if these people are asking its a safe bet there are others who are also in need. The bottom line has been to query a local group, typically Administrators, and return a list of group members. If the member is a domain account, then get a little extra information. I put together a script called Get-Localmember.ps1 that I think will get the job done for most of you.   More »
More fun with Microsoft Word and PowerShell
Friday, August 15th, 2008 by Jeffery Hicks
I needed a demonstration for one of my last online PowerShell classes on using COM objects in PowerShell. I took an old VBScript that used Microsoft Word to get document statistics such as word and page count and transformed it into PowerShell. I quickly realized I could flesh out the demo into a larger function that I can actually use. Given that I generate a lot of Word docs, being able to get some document statistics is helpful. So I created a function called Get-DocStatistic.   More »
Analyze-Packet Reloaded
Thursday, August 14th, 2008 by Jeffery Hicks
While getting caught up on my podcast back log I was listening to an episode of Mind of Root. In it Steven Murawski mentioned my Get-Packet and Analyze-Packet PowerShell scripts. One of his (legitimate) issues with Analyze-Packet was the way it presented results. The original version simply wrote information to the console. It didn't use a good object model so that you could format the results the way you wanted. I took this as a challenge to improve the script.   More »
Get-Packet
Thursday, July 10th, 2008 by Jeffery Hicks
A few days ago I blogged about packet sniffer PowerShell script. Needless to say I was intrigued and spent some time dissecting to better understand it. Don't worry, no PowerShell scripts were harmed during this operation. This is a nifty piece of PowerShell coding. Of course I'm never one to leave well enough alone so I had to add a few touches which I hope the original author doesn't mind.   More »
Emit custom objects, rather than text, from functions and scripts
Sunday, March 23rd, 2008 by Don Jones
Whenever possible, functions (especially) and scripts (to a lesser degree) should emit custom objects, not just text. This ensures that the output of these constructs…   More »