Posts Tagged ‘Add-Member’
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 »
Tags: Add-Member, automation, com, function, Microsoft Word, New-Object, objects, powershell, scriptblock, scripting, Write-Progress
Posted in Windows PowerShell | No Comments »
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 »
Tags: Add-Member, DNS, Network Trace, New-Object, Packet, powershell, scripting, sniff, Write-Progress
Posted in Windows PowerShell | 3 Comments »
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 »
Tags: Add-Member, Network, powershell, scripting, Trace
Posted in Windows PowerShell | 2 Comments »
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 »
Tags: Add-Member, custom objects, function output, New-Object, powershell
Posted in Howto, Windows PowerShell | No Comments »