I am creating custom forms and adding it to the printer server properties using forms.vbs and running it through cmd. The script is as follows
cscript 'C:\Tools\forms.vbs' -a -n "DD" -u inches -h 7.48 -w 7.48 -t 0 -e 0 -b 7.48 -r 7.48
This works fine when running in command prompt.
Now I invoked this code to the powershell as follows and it also works fine
$formname = "DD"
$cmd = "cscript 'C:\Tools\forms.vbs' -a -n " + '"' + $formname + '"' + " -u inches -h 7.48 -w 7.48 -t 0 -e 0 -b 7.48 -r 7.48 "
Invoke-Expression $cmd
The issue started when I thought of checking the error handling thing for the powershell invoke expression.
In cmd when we give the expression as
cscript 'C:\Tools\forms.vbs' -a -n "DD" -u inches -h 7.48 -w 7.48 -t 0 -e 0 -b 0 -r 0
This will definitely throw error as per the notes given in the form.vbs and it will not create a form.
So when I invoked the same error-thrown script to my powershell, the form is not creating as well as it is not throwing any errors. So I request me to guide in this regard. Thanks in advance.