Created
January 22, 2022 16:54
-
-
Save b-wilder/839d404bd22786546257d12f48d44e03 to your computer and use it in GitHub Desktop.
Execute all apex scripts in a folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Loop through all .apex scripts in the directory passed to $args[0] and execute them in sequence | |
$path = $args[0] | |
Get-ChildItem $path -Filter *.apex | | |
Foreach-Object { | |
# $_ : object in loop | |
# $_.FullName: full path to file, including extension | |
# $fileName: filename and extension without path | |
$fileName = Split-Path -Path $_.FullName -Leaf -Resolve | |
sfdx force:apex:execute -f "$path\$fileName" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Execute all apex scripts in the scripts\apex\postdeployment folder after deploying metadata | |
powershell -File .\scripts\ps\executeApexScripts.ps1 ".\scripts\apex\postdeployment" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Execute all apex scripts in the scripts\apex\predeployment folder before deploying metadata | |
powershell -File .\scripts\ps\executeApexScripts.ps1 ".\scripts\apex\predeployment" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment