Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I'm running a script that invokes a powershell prompt and fires some commands. During this process, the powershell program triggers a browser window where a user needs to enter his credentials and press the login button. Once it's done, user sees the welcome screen and enter a verification button. Now, rest of the script runs.

I don't understand how to handle this browser window during the execution of this Perl script. The browser window that opens up doesn't display the url as well.

Below is the code that I'm running-

unlink "powershell.out" if (-e ".\powershell.out"); $input = "date"; $program = "powershell.exe -STA -ExecutionPolicy RemoteSigned -command + - >> powershell.out"; $pid = open(WRITEME, "| $program") or die "Couldn't fork: $!\n"; print WRITEME "date\n"; print WRITEME ". ./PowerShell/common/Get-SepmRmmWsAccessToken.ps1 -sym +-383925ff28c -port 8446\n"; print WRITEME "Get-SepmRmmWsAccessToken -HostName -Port +8446 -ClientId 7cbce559-2eca-4ff8-806b-b2e511a239d0 -ClientSecret 729 +05a1c-2953-4607-bb9a-0e92060308b7"; close(WRITEME) or die "Couldn't close: $!\n"; waitpid($pid, 1);

Please let me know your valuable inputs.

In reply to How to handle a browser window that opens up during the execution of some external program commands by tarunmudgal4u

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    [LanX]: "DH" eq "Dumb Homies "?
    [shmem]: no, no previous, and python just accepts that.

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (9)
    As of 2018-03-20 18:21 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (257 votes). Check out past polls.