You don’t have to choose between the traditional command line interface (CLI) and PowerShell. You can easily run a PowerShell command or even a PowerShell script directly from a command prompt. This means you can integrate some PowerShell functionality into your older batch files. It also means that you can create a scheduled task to execute a PowerShell script!
Category: Windows PowerShell
Extending Types – Okay, already
Having been asked plenty of times, here’s the type extension I added to create the CanPing property for the String type.
Weather Report
If you’ve been following along in our blogs, you’ve hopefully read my posts about using the SAPI.SPVoice COM object. I’ve been trying to come up with some practical applications. I’ve developed one that gets a weather report for your zip code and delivers the weather to you. The script uses a .NET weblclient object to retrieve an XML page from Yahoo! weather.
Convert VBScript to PowerShell!
Here’s an AWESOME resource: http://www.microsoft.com/technet/scriptcenter/topics/winpsh/convert/default.mspx, the Scripting Guys’ complete guide to VBScript functions… or, more specifically, how to do each VBScript function in Windows PowerShell! It’s available online, or you can download the whole thing as a Word document. For each VBScript function or statement, you’ll see a Windows PowerShell version along with a brief explanation. Not that there’s …
Tip: CLI to PowerShell
If you have PowerShell installed (and if you don’t what are you waiting for?) you may be used to starting PowerShell from the Start Menu shortcut. But that’s not the only way.
UPDATED: Happy Holidays – Here’s Our Free Scripting Gift To You!
Happy Holidays from SAPIEN Technologies! In celebration of the season, we’d like to offer you a special gift: A free sampler pack of Snippets to add into PrimalScript (or use independently, if you prefer – they’re just text files)! This 47-Snippet sampler pack includes snippets for VBScript, Windows PowerShell, KiXtart, and even HTAs, and normally retails for $50.00. But if …
Remote Event Log Filtering
Recently I showed how to use Get-EventLog to filter for recent eventlogs. I like this cmdlet because the output is easy to read. One drawback is that you can’t use the cmdlet to query a remote system. Right now, Get-Wmiobject is one of the few cmdlets that allows you to connect to a remote system. Which is great because we can use WMI to query for Win32_NTLogEvents. One primary challenge here is converting date time into a WMI recognized format.
PowerShell Event Log Filtering
I recently helped a fellow scripting admin with a PowerShell problem in the ScriptingAnswers.com PowerShell forum. He wanted to get Errors and Warnings that had happened in the last 30 minutes. Using the Get-EventLog cmdlet would seem like the write solution but it takes a little wrangling to get the information you want.
The Subtle Function
Time for my big epiphany of the week: Why PowerShell functions are so gosh-darned weird. Here?s the deal: Normally, in most programming languages, in order to return a value form a function you have to use a special value. Like, ?Return.? Consider the following example: Function MyFunction() { $f = 1 Return $f} In fact, this is […]
Don’t miss the Microsoft PowerShell Contest
Time is running out to enter the Microsoft PowerShell contest. Deadline for script submissions in December 15, 2006. You can win some pretty great prizes