<div dir="ltr"><div>I've been using PowerShell for a while at work.  I'm not saying that I necessarily "love" it, but it definitely is an improvement over the older DOS batch stuff.</div><div><br></div><div>Basically, Microsoft decided to come up with their own native scripting language for the Windows environment and created PowerShell.  They borrowed concepts from other languages (including Perl) when they made PowerShell.</div><div><br></div><div>Here's some of the aspects that (in my opinion) make PowerShell better than the older DOS command prompt environment.</div><div>    - added in regex support</div><div>    - you can pipe output from one cmdlet to another  (They call PowerShell "commands" cmdlets.)</div><div>        -  This is true even for the cmdlets that return objects.  In that case, you're piping objects and not just text.</div><div>    - If you set up parameters for your PowerShell scripts correctly (instead of directly pulling from $Args), the Get-Help cmdlet will provide some of the basic usage output for you.</div><div>    - built-in parsers for CSV and XML with the Import-CSV and Select-Xml cmdlets</div><div>        - These cmdlets don't provide the fine tuning options that some of the CSV and XML modules do in Perl.</div><div>    - PowerShell can natively use .NET libraries.  (This is one method for providing a GUI interface for your PowerShell scripts.)</div><div>    - Microsoft is moving more of their products and Windows management to be accessible from PowerShell.</div><div>    - Ability to dot source another file (e.g. You have functions in functions.ps1.  Then in your MyScript.ps1, you can pull in and use functions.ps1 by using ". ./functions.ps1" in your script.)</div><div>    - error handling functionalities</div><div>    - With the Start-Job and Wait-Job cmdlets, you can run stuff in the background while your main script does other tasks and also have the main script wait for the background stuff to get finished before moving on.</div><div>    - The Get-Member cmdlet is very helpful in digging into the structure (methods and properties) of objects that you don't have documentation for.</div><div><br></div><div>However, there are (at least from my perspective) a few drawbacks with PowerShell.</div><div>    - Prior to Windows Server 2008 and Windows 7, older Windows versions don't natively have PowerShell installed.  (Vista might have PowerShell, but can't say for sure off the top of my head.)</div><div>        - Depending on how old the Windows version is, I believe that you can add in PowerShell.</div><div>    - Newer versions of PowerShell have added functionality not available in older versions.</div><div>        - For example, PowerShell 1.0 and 2.0 do not have cmdlets available to retrieve/configure NIC settings.  These functionalities was added in PowerShell 3.0.  I haven't use this yet, but from what I can tell, I think using these cmdlets would be much easier than trying to use the older netsh utility.</div><div>    - I have found that Microsoft's PowerShell documentation has been very difficult to find.  And when you can find it, I personally found it to be somewhat lacking - as in not documenting or providing examples for the cmdlet option that I'm trying to figure out how to use.</div><div><br></div><div>At this point, if I'm personally trying to script something in Windows and want to use what is natively available, I'd use PowerShell.</div><div><br></div><div>For anyone wanting to look into PowerShell and looking for basic documentation, here's a few links that might be helpful:</div><div>    -  PowerShell 2.0</div><div>        - basic cmdlet information -- <a href="http://technet.microsoft.com/en-us/library/dd347701.aspx">http://technet.microsoft.com/en-us/library/dd347701.aspx</a></div><div>        - about topics -- <a href="http://technet.microsoft.com/en-us/library/dd347616.aspx">http://technet.microsoft.com/en-us/library/dd347616.aspx</a></div><div>    -  PowerShell 3.0 and newer<br></div><div>        - <a href="http://technet.microsoft.com/en-us/library/hh847840.aspx">http://technet.microsoft.com/en-us/library/hh847840.aspx</a></div><div><br></div>John Ellyson</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 7:58 PM, Mike Flannigan via Houston <span dir="ltr"><<a href="mailto:houston@pm.org" target="_blank">houston@pm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 9/16/2014 1:02 AM, Zakariyya Mughal via Houston wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Heheh, I'm still in university and I'm showing people Perl tricks that<br>
blow their minds. People these days just don't use dynamic languages to<br>
their full capability. They just learn the basics and stop. :-P<br>
<br>
I just went to Houston Techfest[*] this weekend (as I have for a number<br>
of years now) and I'm mostly seeing C# and JavaScript. There used to be<br>
a larger Java presence and even some Ruby, but that has seemed to waned.<br>
I'm wondering, would anyone want to present some Perl there next year? I<br>
think I may have got someone interested in looking at DBIx::Class.<br>
<br>
Also, have any of you checked out PowerShell? It's got a very terse<br>
syntax. I may have to steal some of it for Perl.<br>
<br>
Cheers,<br>
- Zaki Mughal<br>
</blockquote>
<br>
<br></span>
I didn't know I had PowerShell on this Win7 machine<br>
of mine.  I'm watching tutorial 1 of 5 right now.  This<br>
guy sure gets excited about things that don't seem all<br>
that cool to me, but it sure is cool to him.  He is easily<br>
impressed.<br>
<br>
I guess this PowerShell is a little bit better than the<br>
command prompt I am using now, but not much better in<br>
my opinion.  I really need to find a better one.<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
Mike<br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Houston mailing list<br>
<a href="mailto:Houston@pm.org" target="_blank">Houston@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/houston" target="_blank">http://mail.pm.org/mailman/<u></u>listinfo/houston</a><br>
Website: <a href="http://houston.pm.org/" target="_blank">http://houston.pm.org/</a><br>
</div></div></blockquote></div><br></div>