05-06-2019, 04:57 AM
thank you for your reply
I used the above code to test that pscmd3 cannot call jint.dll
Macro PSrunjs
I used the above code to test that pscmd3 cannot call jint.dll
Macro PSrunjs
str s
_s=
;function Invoke-JSAdd ($a, $b) {
;;;;;Add-Type –Path "C:\Jint.dll"
;;;;;;;;;;;;;;
;;;;;$JavaScript = "
;;;;;;;;;function add(a, b) {
;;;;;;;;;;;;;return a + b;
;;;;;;;;;}
;;;;;"
;;;;;$add = (New-Object Jint.Engine).
;;;;;;;;;;;;;Execute($JavaScript).
;;;;;;;;;;;;;GetValue("add")
;;;;;;;;;;;;;;
;;;;;$add.Invoke($a, $b).ToString()
;}
;
;Invoke-JSAdd 5 6
PsCmd _s "-Version 5.0" s ;;success But there are extra characters
;PsCmd3 _s "" s ;;failure
;PsCmd3 _s "-Version 2.0" s ;;failure
;PsCmd3 _s "-Version 5.0" s ;;failure
mes s