Script include script is not working from Service Portal catalog client script GlideAjax

Change the privacy setting for a single client-callable script include by adding theisPublic() function.   The isPublic() setting takes precedence over the glide.script.ccsi.ispublic property. For example, if the property is set to false making all client-callable script-includes private, and a script sets isPublic() to true, the script is public.   To change the privacy for […]

Execute powershell script from ServiceNow workflow run script activity

var pScript = “Script that needs to be executed”; var powershell = new PowershellProbe(‘MID_SERVER_NAME’, gs.getProperty(‘mid.server.ip’)); powershell.setScript(pScript); var resp = powershell.execute(true); workflow.scratchpad.error = resp.error; workflow.scratchpad.output = resp.output; if(!resp.output.nil() && resp.output ! = ‘null’) current.work_notes = resp.output; else if(!resp.error.nil()) { current.work_notes = ‘Error in script:  ‘ + resp.error; } gs.log(‘Response Output ‘ + resp.output); gs.log(‘Response Error ‘ […]