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.7k points)

2 Answers

0 votes
by (14.9k 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 (300 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

I have a number of custom Powershell scripts that add users to Teams, groups, etc. I re-use these scripts dozens of times for different conditions and only change one ... possible to convert this script to a custom command and pass parameters to it instead?

asked Dec 16, 2024 by cwyant-hfg (40 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, 2024 by wintec01 (1.7k 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, 2024 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, 2024 by curtisa (330 points)
3,614 questions
3,301 answers
8,366 comments
548,577 users