Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello. How do I run the following from a Perl script on Windows?
get-wmiobject Win32_ComputerSystemProduct | Select-Object -ExpandPrope +rty UUID # this runs fine from command line
The followings do not work
my ($UUID) = system ("get-wmiobject Win32_ComputerSystemProduct | Sele +ct-Object -ExpandProperty UUID"); # 'get-wmiobject' is not recognized + as an internal or external command my ($UUID) = system ('get-wmiobject Win32_ComputerSystemProduct | Sele +ct-Object -ExpandProperty UUID'); my ($UUID) = `get-wmiobject Win32_ComputerSystemProduct | Select-Objec +t -ExpandProperty UUID`; # same error as above, `` works perfectly fi +ne on macOS
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: running command line from Perl
by LanX (Saint) on May 18, 2022 at 11:54 UTC | |
by karlgoethebier (Abbot) on May 18, 2022 at 13:40 UTC | |
by LanX (Saint) on May 18, 2022 at 14:32 UTC | |
by Anonymous Monk on May 18, 2022 at 12:11 UTC | |
by LanX (Saint) on May 18, 2022 at 12:41 UTC | |
by Anonymous Monk on May 18, 2022 at 14:50 UTC | |
by NetWallah (Canon) on May 18, 2022 at 15:14 UTC | |
| |
by ikegami (Patriarch) on May 18, 2022 at 17:57 UTC | |
by LanX (Saint) on May 18, 2022 at 12:12 UTC | |
by Anonymous Monk on May 18, 2022 at 12:44 UTC | |
|
Re: running command line from Perl
by soonix (Chancellor) on May 18, 2022 at 13:16 UTC | |
by cavac (Prior) on May 19, 2022 at 07:08 UTC | |
by LanX (Saint) on May 19, 2022 at 18:44 UTC | |
by cavac (Prior) on May 23, 2022 at 05:25 UTC | |
by LanX (Saint) on May 23, 2022 at 11:37 UTC | |
|
Re: running command line from Perl
by Anonymous Monk on Jun 08, 2022 at 02:10 UTC |