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 (289k 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

Hi, we're trying to map certain actions to business rules, is there anyway to see the action in a more readable way? Adding a user to a group seems to show the following: { ... to dump the entire content of "$context" so that I can see what might be usable?

asked Jul 29 by ZoomGhost (280 points)
+2 votes
1 answer

Most of my PowerShell code is written in VS Code and then copied/pasted to the Adaxes script editor. However, if you use $Context in your scripts, you can't execute them ... = [Context]::new() $Context.LogMessage("foo", "information") Output: [Information] foo

asked Nov 3, 2023 by ngb (290 points)
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)
3,548 questions
3,239 answers
8,232 comments
547,814 users