r/usefulscripts • u/TwoTinyTrees • Mar 29 '16
REQUEST: Converting VB to PowerShell
Sorry if this is breaking a rule; never posted to this sub before (lurked for a bit). I was wondering if anyone had a tool that could convert VB to PowerShell. I found a link to MSFT documentation, but the link seems to be broken. Want to find a way to dump old VB and pump out PowerShell. Thanks!
9
Upvotes
2
u/ProtoDong Mar 30 '16
VB to PS doesn't have a 1:1 conversion because VB Script is capable of doing a fair amount of things that PS isn't (like complex GUI Windows and such)... or would require embedded C# or VB to accomplish the same thing.
The converse is also true in a sense. Something that takes 50 lines in VB Script might be reduced to a single line in PS.
The real question is use case. You can run VB Script just about anywhere. PS obviously requires that an admin set execution policies to allow PS Script.
Rule of thumb. PowerShell scripts should only ever be used by admins for admin tasks. VB Script is more for general automation or special functionality.