1

Could someone try to help me out to run a Perl program from a PowerShell script? I'm trying to save the script results into a PowerShell variable.

So far, I have tried the below from the Powershell ISE. But it does not seem to be working.

perl 'C:\Program Files (x86)\ABC\ABC Software\bin\testcheck.pl -print verbose'

Powershell Script Path: C:\MyScripts
Perl Program Dir: C:\Program Files (x86)\ABC\ABC Software\perl\bin\perl.exe

5
  • 1
    perl 'C:\Pr...in\testcheck.pl -print verbose' -> perl 'C:\Pr...in\testcheck.pl' -print verbose. If that doesn't help you need to provide more information. Did you add the path to the Perl executable in your PATH envirenment variable. Also, how exactly is it "not working"? Commented Jul 27, 2019 at 14:35
  • Can I explicitly mention the Perl executable path in the script itself? Commented Jul 27, 2019 at 16:16
  • I'm getting the following message perl : The term 'perl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Commented Jul 27, 2019 at 16:17
  • 2
    Re "I'm getting the following message perl : The term 'perl' is not recognized as", That means that perl.exe isn't in your path. You'll need to provide the full path to perl.exe (& 'C:\Program Files (x86)\ABC\ABC Software\perl\bin\perl.exe' 'C:\Program Files (x86)\ABC\ABC Software\bin\testcheck.pl' -print verbose) Commented Jul 27, 2019 at 18:13
  • 2
    Re "Can I explicitly mention the Perl executable path in the script itself?", You could create a file association. Then, you'd simply treat the script as the program to run ( (& 'C:\Program Files (x86)\ABC\ABC Software\bin\testcheck.pl' -print verbose) Commented Jul 27, 2019 at 18:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.