aku1 发表于 2007-8-23 14:01:51 | This guide is intended to help you “translate” VBScript scripts to Windows PowerShell scripts. However, this is not designed to be a word-for-word translation guide; for better or worse, things don’t quite work that way. Instead, consider this a reference as you begin writing Windows PowerShell scripts. After all, sooner or later you’re bound to run into a situation where you find yourself thinking, "OK, I need to use a Select Case statement here. I know how to do that in VBScript, but how do I do that in Windows PowerShell?” That’s where this guide can come in handy; it takes all the VBScript functions, statements, and operators and shows you, as much as possible, a Windows PowerShell equivalent.
Incidentally, we tried to find an equivalent for most of the commands in the VBScript Language Reference; however, we would never claim that we found the best equivalent for these commands. If you know of a better/faster/easier way to, say, format a number as currency in Windows PowerShell, please let us know. We’ll publish any alternate approaches as an addendum to this guide.
Download this conversion guide as a Word document (along with Windows PowerShell Week sample scripts).
VBScript Functions
|
|
|
|
VBScript Statements
|
|
|
|
Err Object Properties and Methods
VBScript Operators
|
|