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.
Tag: scripting
Analyze-Packet Reloaded
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.
PowerShell InputBox
The other day I gave you a function to create a VBScript style message box in PowerShell. If you find yourself needing MsgBox in PowerShell, you’re likely going to want InputBox.
PowerShell, VBScript, Shells and Cmdlets
We are currently running a survey about PowerShell adoption. If you haven’t had a chance yet to participate, please go here to do so: Take the survey I would like to thank all those who already took the survey for participating and for leaving a huge amount of very interesting comments. One thing that really […]
New PrimalToys object for easier CSV handling
With service build 569 of PrimalScript 2007 we added a COM object that makes it easier to deal with CSV (comma separated values) data and/or files. While browsing through posts at ScriptingAnswers.com and some of Microsoft’s scripting related newsgroups I couldn’t help but notice that questions regarding CSV keep coming up. I mentioned this to […]
PowerShell and COM objects.
While developing a COM object for scripting use I wanted to provide a VBScript sample as well as a PowerShell sample. While creating the PowerShell sample I received an unexpected error message when setting a property value. Some quick review shows that PowerShell 1.0 (I did not check with the 2.0 CTP yet) cannot handle […]
Touch This
One of the last tasks for the Active Directory Powershell book was to assemble all the script samples. When the book is available you’ll be able to download a zip file from SAPIENPress.com. One thing I wanted to do was to use the file time stamp as a versioning tool.
PowerShell 101 now part of PrimalScript 2007 Enterprise Edition
As of August 1st 2008 every CD of PrimalScript 2007 Enterprise shipped will include a copy of our PowerShell 101 Class-On-Disc. To find out more about this title please look here: PowerShell 101 If you already own PrimalScript 2007 Enterprise you can order a replacement CD with PowerShell 101 from ScriptingOutpost.com Ordering will require a […]
More Fun with Debug Messages
A few weeks ago I posted an entry on creating customized debug messages that you can use in your scripting. After some more testing and tweaking I revised and renamed the function. Write-DebugMessage can now be used within your script to send messages to the debug pipeline. I moved the $debugpreference setting to the function itself and made other improvements.
PowerShell: DriveUtilization
The other day I posted a VBS function for getting drive utilization. It seems only fair to give PowerShell a chance to play.