Can someone explain why we should need powerscript.

0 views
Skip to first unread message

Ronald

unread,
May 9, 2006, 4:24:01 AM5/9/06
to
Since I can do almost anything with VBS.
--
Ronald
Eindhoven
Netherlands

Andrew Watt [MVP]

unread,
May 9, 2006, 6:05:44 AM5/9/06
to

Ronald,

PowerShell is based on the .NET Framework so it will fit in much
better with Microsoft's next generation operating systems and tools.

I think it's also easier for newcomers to learn PowerShell since it's
much more succinct than VBS can be.

You can use PowerShell on the command line. You can't do that with
VBS, as far as I am aware.

PowerShell is intended to be more secure than VBS. Time will tell, I
guess, but improved security is part of the PowerShell design team's
thought pattern. PowerShell is to be used under the covers for
Exchange 2007. I doubt very much if it would have been possible to
persuade the Exchange 2007 team to use VBS.

Just my $0.02. Other people will, no doubt, highlight a different
group of reasons. Emphases / interests vary.

Andrew Watt MVP

McKirahan

unread,
May 9, 2006, 6:42:52 AM5/9/06
to
"Andrew Watt [MVP]" <SVGDev...@aol.com> wrote in message
news:h0q0629jvupbhu96a...@4ax.com...

> On Tue, 9 May 2006 01:24:01 -0700, Ronald
> <Ron...@discussions.microsoft.com> wrote:
>
> >Since I can do almost anything with VBS.
> >--
> >Ronald
> >Eindhoven
> >Netherlands

[snip]

> You can use PowerShell on the command line. You can't do that with
> VBS, as far as I am aware.

[snip]

"CScript.exe" runs VBScript via the command line.


Ronald

unread,
May 9, 2006, 6:41:02 AM5/9/06
to
Andrew , thanks for your prompt answer but VBS can be run in a cmd shell.
Security is a matter of implementation and that leaves Exchange 2007 as the
sole reason i.m.h.o. to move to powerscript. I don't know how long MS will
continu to support VBS. But I'm afraid that discontinuing support does not
look very friendly to all people who have been investigating time and effort
in VBS.
For the newcomers VBS is great if you want to move on to VB or already have
some experience with VB.
--
Ronald
Eindhoven
Netherlands

klu...@xtra.co.nz

unread,
May 9, 2006, 7:45:49 AM5/9/06
to
correct me if i am wrong but

1) typing cscript before each command you want to do on the comandline
is tedious
2) each time you are calling cscript, its a fresh and new "enviroment"
(ie global variables don't exist over that boundary etc)

i think that for interactively exploring and interacting with the
system, powershell is much more productive, and also with the rich
piping constructs, more powerful, and consistant.

VBS has its uses, but in many cases its not hte optimal tool for the
job, its just the defacto tool.

Karl

Jeffrey Snover [MSFT]

unread,
May 9, 2006, 8:27:52 AM5/9/06
to
If VBS does everything that you want - there is no need to consider anything
else.

--
Jeffrey Snover [MSFT]
Windows PowerShell Architect
Microsoft Corporation
This posting is provided "AS IS" with no warranties, no confers rights.
"Ronald" <Ron...@discussions.microsoft.com> wrote in message
news:B9A80C1E-28DA-487C...@microsoft.com...

ebgreen

unread,
May 9, 2006, 9:12:02 AM5/9/06
to
You could do most anything with Batch files too. So who needs VBScript even?

Andrew Watt [MVP]

unread,
May 9, 2006, 10:22:38 AM5/9/06
to
On Tue, 9 May 2006 05:42:52 -0500, "McKirahan" <Ne...@McKirahan.com>
wrote:

Yes, you can run scripts. With PowerShell you can type PowerShell
commands direct on the command line, tweak them to do what you want
and then use those same commands in a script. It's a feature I like.

Andrew Watt MvP

Steve Foster [SBS MVP]

unread,
May 9, 2006, 10:35:38 AM5/9/06
to
Ronald wrote:

>Andrew , thanks for your prompt answer but VBS can be run in a cmd shell.

No, you can launch CSCRIPT/WSCRIPT and have them work through a saved VBS
file. You cannot type VBS commands into a command prompt, and have them
execute one at a time.

--
Steve Foster [SBS MVP]
---------------------------------------
MVPs do not work for Microsoft. Please reply only to the newsgroups.

Steve Foster [SBS MVP]

unread,
May 9, 2006, 10:38:18 AM5/9/06
to
McKirahan wrote:

Not interactively, it doesn't. You cannot start CScript and then type in
VBS commands, one at a time, and have them executed.

VBS is an interpeted programming language. You write small programs, save
them as VBS files, and then execute them with CSCRIPT or WSCRIPT.

PSH is a command shell. You can type commands in and have them executed
instantly, or you can create "batch files" of multiple PSH commands and
execute them together.

Thomas Lee

unread,
May 9, 2006, 12:04:50 PM5/9/06
to
In message <B9A80C1E-28DA-487C...@microsoft.com>, Ronald
<Ron...@discussions.microsoft.com> writes

>Since I can do almost anything with VBS.

Powershell is for admins, vbs is for programmers.


--
Thomas Lee
doct...@gmail.com
MVP - Admin Frameworks and Security

Michael McMullen

unread,
May 9, 2006, 2:44:02 PM5/9/06
to
As a programmer, I have to object to that :). I never really liked VBS, if I
couldn't do something on the command line, I'd jump straight to C#, which was
sometimes a bit of overkill, but was better than using VBS. PowerShell fills
the gap perfectly.

/\/\o\/\/

unread,
May 9, 2006, 4:52:17 PM5/9/06
to
Almost the same here,
I as an admin did revert to VB.NET before PowerShell

also I nice point for PowerShell

in Vbscript I mostly needed to start from a template.

In PowerShell I can start from scratch easy, what does save my a lot of
time searching trough old scripts


gr /\/\o\/\/

klu...@xtra.co.nz

unread,
May 9, 2006, 7:07:56 PM5/9/06
to
i would have to agree.

VBS to me was just a neccisary evil for certian tasks, where making an
executable wasn't desirable.

klu...@xtra.co.nz

unread,
May 9, 2006, 7:11:44 PM5/9/06
to
i love the humility !!

but i think, that he is thinking whether its worth to learn powershell
or not. I think if you look at powershell on the surface you mightn't
really get the advantages. the uniqueness, value and power of
powershell is something that needs to really be experienced to be able
to comprehend it. There are about 5 or 6 really great and powerful
areas, and concepts that need to be "gotten", for myself there were a
number of "AHHHH" moments, where it all clicked, and the possibilities
opened up in my mind. ronald, i think jeffery does a great job at
communicating the value and application of powershell, and would
recommend viewing some of the video demostrations that are around (i.e
on channel9.msdn.com)

Karl

Michael Harris (MVP)

unread,
May 9, 2006, 8:25:33 PM5/9/06
to
>> "CScript.exe" runs VBScript via the command line.
>
> Not interactively, it doesn't. You cannot start CScript and then type
> in VBS commands, one at a time, and have them executed.

Actually early versions of cscript did have an interactive command line mode
that was never officially advertised or documented. It was later removed
due to security concerns. I don't even remember the syntax anymore.

--
Michael Harris
Microsoft MVP Scripting


Michael Harris (MVP)

unread,
May 9, 2006, 8:28:19 PM5/9/06
to
Jeffrey Snover [MSFT] wrote:
> If VBS does everything that you want - there is no need to consider
> anything else.

Or (like me) you are still trapped in a W2K world :-(...

Jeffrey Snover [MSFT]

unread,
May 10, 2006, 10:44:32 AM5/10/06
to
> You could do most anything with Batch files too. So who needs VBScript
> even?
You can do most anything by toggling the switches on the front panel of a
PDP 11 as well.
Those were the days!
When to came to interacting with the computer - you always knew who was in
charge.
(I'll leave it ambiguous as to whether I'm joking or not)

Jeffrey Snover [MSFT]

unread,
May 10, 2006, 10:46:12 AM5/10/06
to
Another way to say it would be:

vbs REQURIES programming skills
PowerShell TAKES ADVANTAGE of programming skills.

--
Jeffrey Snover [MSFT]
Windows PowerShell Architect
Microsoft Corporation
This posting is provided "AS IS" with no warranties, no confers rights.

"Thomas Lee" <t...@psp.co.uk> wrote in message
news:M6FX+mGi...@mail.psp.co.uk...

Thomas Lee

unread,
May 10, 2006, 11:11:55 AM5/10/06
to
In message <uYo1ICEd...@TK2MSFTNGP03.phx.gbl>, "Jeffrey Snover
[MSFT]" <jsn...@microsoft.com> writes

>Another way to say it would be:
>
>vbs REQURIES programming skills
>PowerShell TAKES ADVANTAGE of programming skills.

I'd agree with this refinement!

At the same time - for the OP, with VBS, you have to do nearly
everything yourself. For example, if you want to output something, you
have to do it yourself, rather than relying on Out-Default. Likewise,
you can use the shell and enter individual statements in - something
other folks have mentioned.

As ever, Jeffrey is right - this time that PowerShell can be a
programming to - with tests, loops, etc.

Thomas

Andrew Watt [MVP]

unread,
May 11, 2006, 7:35:46 AM5/11/06
to
On Wed, 10 May 2006 07:44:32 -0700, "Jeffrey Snover [MSFT]"
<jsn...@microsoft.com> wrote:

>> You could do most anything with Batch files too. So who needs VBScript
>> even?
>You can do most anything by toggling the switches on the front panel of a
>PDP 11 as well.
>Those were the days!
>When to came to interacting with the computer - you always knew who was in
>charge.
>(I'll leave it ambiguous as to whether I'm joking or not)

Architects aren't allowed to joke, are they? :)

Andrew Watt MVP

StrictlyMike

unread,
May 22, 2006, 8:53:01 PM5/22/06
to
I couldn't help myself--it's not as cool as PowerShell, but it's fun...


<head>
<title>VBScript Command-line</title>
<hta:application>
</head>

<body text="#ffffff" bgcolor="#000000" style="* {font-family: monospace;
font-size: 12px;}">
<div id="spnResults"></div>
<div> vbs:\><input type="text" name="txtInput" style="font-family:
monospace; font-size: 12px; width: 90%; color: #ffffff; background-color:
#000000; border: 0px;"/><button type="submit" name="btnExec"
onclick="F_btnExec()" style="color: #000000; background-color: #000000;
border: 0px;"><u>E</u>val</button> </div>

</body>

<script Language="VBScript">
Function Window_OnLoad()
Call txtInput.Focus()
End Function

Function F_btnExec()
spnResults.InnerHTML = spnResults.InnerHTML & txtInput.Value & "<br/>"
Call txtInput.Focus()
On Error Resume Next
Execute(txtInput.Value)
If Err Then
spnResults.InnerHTML = spnResults.InnerHTML & "<div style=""font-weight:
bold; color: red;"">>>> Error # " & Err.Number & ": " & Err.Description &
"</div>"
Call Err.Clear()
End If
On Error Goto 0
Call txtInput.Select()
End Function
</script>

Reply all
Reply to author
Forward
0 new messages