Tag: Functions

May 28, 2009 / by Jeffery Hicks / Howto, VBScript / 2 Comments

VBScript Includes

I've been using VBScript for a very long time. One drawback it has always had as a scripting language is an INCLUDE statement. In other languages you can use something like INCLUDE scriptfile at the beginning of the script. This would load any functions and variables in the specified script file into your current script. In PowerShell we can accomplish this by dot sourcing scripts. I never knew of a way to do the same thing with VBScript until now.
Read More

May 21, 2009 / by Jeffery Hicks / Howto, Windows PowerShell / 1 Comment

Good, Better, Best

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.
Read More

May 19, 2009 / by Jeffery Hicks / Windows PowerShell / No Comments

Can I Get a Little Help Here?

One of my favorite features in PowerShell v2.0 is the ability to add help scripts and functions. The help system with cmdlets is terrific. Type help and the name of a cmdlet and you get syntax, parameters, a description and examples. In PowerShell v2 you can get this same functionality for your scripts and functions. The example I want to show you will work with PowerShell v2.0 that ships with WIndows 7 Release Candidate. There have been some changes since PowerShell CTP3 so if you want the absolute latest PowerShell bits you'll need Windows 7. Here's what you can look forward to.
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

Categories

Archives

BlogRoll

PowerShell Links

Information

Dashboard