[Tutor] Windows Power Shell

Bill Allen wallenpb at gmail.com
Sat Aug 21 19:31:21 CEST 2010


The very best first feature to learn is the "foreach" command.  It elegantly
solves the icky, age old, problem in DOS batch of reading in a list of
values from a file and doing something with them.   This alone sold me
completely on WPS.

For instance, here is and actual script I used to push an install source to
all my engineering systems at work, listed in computers.txt, by invoking
richcopy<http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-25c359cc0842/HoffmanUtilitySpotlight2009_04.exe>(also
a fantastic utility, Microsoft's modern replacement for robocopy.

get-content computers.txt | foreach -process {richcopy
"\\myNAS\NasShare\NX6\nx6028" "\\$_\c$\nx6028" /TD 10 /QA /QP
"c:\results.log" /US /UD /UE}

Sorry for taking up additional "non-Python" bandwidth, but I got excited
about being able to contribute something back to the group that I actual
know about!  ;-D

Bill

On Sat, Aug 21, 2010 at 12:21 PM, Bill Allen <wallenpb at gmail.com> wrote:

> Alan,
>
> I have used WPS 1.0 for some time at work to script software installs,
> etc.  It is very powerful and gives full .NET visibility to "DOS" level
> scripts.  In fact, it is a plausible replacement for VB for most
> administrative scripting work in the Windows environment.
>
> Some good resources:
> The Hey Scripting Guy <http://blogs.technet.com/b/heyscriptingguy/>!
> Technet blog is an execellent place to start as he focuses heavily on WPS.
> PowerShell.com <http://powershell.com/cs/> WPS community (you can also
> sign up for really good daily WPS tips sent straight to you email here, I
> recommend these tips!)
> TechNet Learning to Script Center<http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx>,
> focuses on WPS.
>
>
> Bill
>
>
>
>
>
> On Sat, Aug 21, 2010 at 3:20 AM, Alan Gauld <alan.gauld at btinternet.com>wrote:
>
>> A recent windows update delivered the Windows Power Shell to my desktop.
>>
>> I'd heard of this but never used it till now. I've only started playing
>> with it but
>> it is essentially DOS on steroids. It brings Windows users a shell that
>> seems
>> to be very close to Unix shells like Bash in power and flexibility (and
>> scripting
>> language). It's very early days yet, but I wondered if any other tutor
>> members
>> had started using WPS?
>>
>> Some examples of the extra features include regex,  objects, process
>> control,
>> remote invocation, better loop structures etc...
>>
>> Regards,
>>
>> Alan G.
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100821/78d39f77/attachment.html>


More information about the Tutor mailing list