0 votes

Hi team,

we are using a lot of custom PowerShell Scripts in our rules and actions. Is there a way to see and search through them? Are they saved somewhere in a readable format?

I need to change some paths and would like to avoid to open every rule and check every PS action.

Thanks

by (1.5k points)

2 Answers

0 votes
by (14.1k points)

Hello,

Unfortunately, there is no possibility to view all the scripts at once. Each script is stored in the corresponding action configuration. However, you can search and replace texts in Adaxes scripts. For details, have a look at the following repository article: https://www.adaxes.com/script-repository/search-and-replace-text-in-adaxes-scripts-s224.htm.

0

That seems to be exactly what I am looking for - thanks! <3

0 votes
by (290 points)

This is one reason we dot source our larger scripts. It also has the advantage of code reuse and makes keeping them under source control easier.

Set-Location c:\scripts\adaxes
".\My-Script1.ps1", ".\My-Script2.ps1"| ForEach-Object {
    if (!(Test-Path -Path $_)) {
        try {
            throw [System.IO.FileNotFoundException]::new("Missing helper script $_.")
        }
        catch {
            $Context.LogException($_.Exception)
            throw
        }
    }
    else {
        # dot source the helper scripts
        . $_
    }
}

Related questions

0 votes
1 answer

Here are the actrions of the custom command. Here are the parameters. Need a script to copy the param user's file path for home drive example: Param user's home drive ... ) should be //server1/homedirs/%username%. Then give the user full control of the folder.

asked Feb 8, 2023 by mightycabal (1.0k points)
0 votes
1 answer

Hi, I have this Script to check if a condition is met # The condition is met if $Context.ConditionIsMet is set to $True. $Context.ConditionIsMet = $False $inputString = " ... or issue with this match function using in a "if script returns true" condition?

asked Oct 31 by wintec01 (1.5k points)
0 votes
1 answer

Trying to create a custom command to run a powershell script, but I keep getting an error saying it can't find the file or path supplied for launching powershell. ... and I can launch powershell from this location using Command Prompt. Am I missing something?

asked Oct 24 by cstaub (100 points)
0 votes
1 answer

Having a strange issue, when executing a powershell command in adaxes as a business rule, the first line, no matter what is there comes up as invalid. Originally my ... line, but I've tried everything and universally the first line is flagged as invalid

asked Oct 23 by curtisa (290 points)
0 votes
1 answer

In a business rule, I'd like to pass Adaxes variables into a powershell script that I'll run. For example, pass %username% into the script so it can be used inside the script.

asked Sep 5 by P-Sysadmin (20 points)
3,548 questions
3,239 answers
8,232 comments
547,814 users