PowerShell is a very interesting and powerful language, which also borrowed many aspects from Perl and some from Haskell.

I never worked with PowerShell, except for casting a few magic spells copied from Google results to make Windows behave.

That should allow doing interesting things WITHIN the PowerShell/.NET walled garden. As long as you can use those objects, everything should be fine (except for bugs). But what about Unix-style interactions with other programs? Piping objects arounds surely is a powerful concept, but can I stuff binary data from STDOUT of tool A into a pipe, then filter it through B, C, D, and finally have E process the result of filtering? (In other words, what's the equivalent of a bash on Unix doing A -foo -bar | B -bla bla | C --what=ever | D ./magic ./stuff  | E +gnarf)

What about networking? I often do things like this:

tar -C /some/where -cf - subtree | ssh root@embedded.system tar -C /else/where -xvf - > copied.txt 2> problems.txt

(Create a tar archive of subtree in /some/where and write to STDOUT, have ssh pass that byte stream to another tar instance running as root on embedded.system as STDIN, make that second tar extract the archive to /else/where, write STDOUT of the second tar to copied.txt on the local system, and STDERR to problems.txt on the local system.)

What about quoting? Quoting the two redirections in the previous command would write STDOUT and STDERR of the second tar to embedded.system, because ssh implicitly invokes a shell on embedded.system:

tar -C /some/where -cf - subtree | ssh root@embedded.system tar -C /else/where -xvf - '>' copied.txt '2>' problems.txt

How to pass things like ", ', <, >, | as arguments? On Unix:

echo '"' "'" \< ">" "|"

Expanding variables, and passing parameters that just look like variable expansions?

echo '$PATH' "expands to \"$PATH\""

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^13: let Makefile.PL to do the Readme file for me -- new target? (Powershell) by afoken
in thread let Makefile.PL to do the Readme file for me -- new target? by Discipulus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.