| |
SAPIENScripter
Posts: 271
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
VBScript is apparently one of the few scripting languages that really differentiates between a sub and a function. In PowerShell, all code blocks that "do something" or return a value are considered functions. The other big difference is that in a .ps1 script, your functions have to come at the beginning of the script. In VBScript, they could be anywhere. But PowerShell processes the script file sequentially like a batch file and the function has to "exist" before it can be called.
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|