Sikuli 2.0.5 - runScript('powershell get-process') return error

Asked by TestMechanic

Tested on 2 windows10 machines, powershell 5.1

runScript('powershell get-process')

result in :
[error] Runner: script not found: powershell get-process

Note: that 'powershell get-process' works fine from console and from windows run menu

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
TestMechanic
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

@TestMechanic
I have got same error.
And another way as follow work fine.

cmd = """
powershell
get-process
"""
runScript(cmd)
bb = RunTime.get().getLastCommandResult()
print bb

Revision history for this message
RaiMan (raimund-hocke) said :
#2

looking into the implementation, it must be so:

runScript('powershell\n get-process')

or

script = """powershell
get-process
"""
runscript(script)

Revision history for this message
RaiMan (raimund-hocke) said :
#3

@masuo
2FAST4ME :-))) all the best RaiMan

Revision history for this message
TestMechanic (ndinev) said :
#4

I got the example from the docs

Example for PowerShell:

returnCode = runScript('powershell get-process')

So maybe it is a documentation bug

Revision history for this message
RaiMan (raimund-hocke) said :
#5

ok, thanks for feedback.

I will correct the docs.