0 votes

I often need to step through a script in the ISE debugger to troubleshoot or verify its operation. My problem is that I haven't been able to find a way to do this with a script that's using the $Context variable as it's only available when the script is run via Adaxes in which case the script is hidden. Is there a way to interactively run a script uses the $Context variable so you can step through/debug it?

by (100 points)

1 Answer

0 votes
by (226k points)
selected by
Best answer

Hello,

$Context variable can be used only in PowerShell scripts executed by Business Rules, Custom Commands, and Scheduled Tasks. Currently, there is no possibility to use PowerShell debuggers.

To check values of variables, you can use the following code in your scripts:

$Context.LogMessage($myvar, "Information")

After script execution the value of $myvar variable will be displayed in the Execution Log.

Related questions

0 votes
1 answer

Hello, We have a problem with the way Adaxes detects % as variables in all PowerShell scripts. We are configuring a HTML email template for all out going emails from the system ... this is a start of a variable. Is there anyway around this? Regards, ice-dog

asked Feb 22, 2019 by ice-dog (170 points)
0 votes
1 answer

We need to use two attributes for our new Cisco phone implementation. The ipphone attribute is being set with a 11 digit number that always starts with 91, but we need to ... way to strip the 91 off of the ipphone attribute and set it to otheripphone? Thanks

asked Aug 7, 2013 by jiambor (1.2k points)
0 votes
1 answer

Hi - I'm testing how granular we can get with reducing "non-necessary" access rights and would like to know if there are any logs we can check for more info on blocked ... it is very hit and miss trying to work out what access needs to be configured! Rgds

asked Jan 16, 2013 by firegoblin (1.6k points)
0 votes
1 answer

I am trying to send a $context.logmessage from a condition script in a Scheduled Task but I get nothing in the log. Is this not possible? Morten A. Steien

asked Jul 20, 2020 by Morten A. Steien (150 points)
0 votes
1 answer

Hi I've written the script below which reads the contents of a file from the network and write this to a users "adm-CustomAttributeText1" field. The code works as ... the value is not written to the attribute. Any help would be greately appreciated. Thanks

asked Feb 2, 2016 by chappers77 (1.2k points)
2,779 questions
2,512 answers
6,574 comments
26,511 users