In SAM when creating a "Windows Script Monitor" with the "Script Engine" set to rubyscript, I can't acces script arguments in a ruby script invoked through WSH.
The following VB code works fine with the "Script Engine" set to vbscript.
WScript.Echo "Statistic.0:", WScript.Arguments.Length
WScript.Echo "Message.0: there are ", WScript.Arguments.Length, " arguments"
With script arguments a b c d
Produces
Script Output:
Message.0: | there are 4 arguments | |
Statistic.0: | 4 |
However, the following ruby code with the "Script Engine" set to rubyscript, does not give the expected results.
puts "Statistic.0: #{ARGV.length}"
puts "Message.0: there are #{ARGV.length} arguments"
With script arguments a b c d
Produces
Script Output:
Message.0: | there are 0 arguments | |
Statistic.0: | 0 |
Can anybody, confirm, deny, or fix this please?ruby wsh