diff --git a/sf-check.ps1 b/sf-check.ps1 index cdd65be..2723144 100644 --- a/sf-check.ps1 +++ b/sf-check.ps1 @@ -1,6 +1,6 @@ param( - [switch]$v, - [switch]$h + [switch]$vb, + [switch]$hp ) function Show-Help { @@ -8,11 +8,11 @@ function Show-Help { sf-check.ps1 — verify Salesforce CLI environment and configuration USAGE: - sf-check.ps1 [-v] [-h] + sf-check.ps1 [-vb] [-hp] OPTIONS: - -v Verbose output (show detailed information) - -h Show this help + -vb Verbose output (show detailed information) + -hp Help - show this help DESCRIPTION: This script verifies that the Salesforce CLI is properly installed and configured. @@ -24,7 +24,7 @@ DESCRIPTION: EXAMPLES: sf-check.ps1 # Basic environment check - sf-check.ps1 -v # Verbose output with detailed information + sf-check.ps1 -vb # Verbose output with detailed information "@ } @@ -276,13 +276,13 @@ function Test-Diagnostics { } # Show help if requested -if ($h) { +if ($hp) { Show-Help exit 0 } # Set verbose flag -$Verbose = $v +$Verbose = $vb # Main execution function Main { @@ -328,7 +328,7 @@ function Main { if (-not $Verbose) { Write-Host "" - Write-Host "Run 'sf-check.ps1 -v' for detailed system information." + Write-Host "Run 'sf-check.ps1 -vb' for detailed system information." } } } diff --git a/sf-deploy.ps1 b/sf-deploy.ps1 index c18f496..7a36713 100644 --- a/sf-deploy.ps1 +++ b/sf-deploy.ps1 @@ -1,9 +1,9 @@ param( - [string]$o = "", - [string]$s = "", - [string]$d = "", - [string]$t = "", - [switch]$h + [string]$to = "", + [string]$sr = "", + [string]$dr = "", + [string]$ts = "", + [switch]$hp ) function Show-Help { @@ -11,53 +11,53 @@ function Show-Help { sf-deploy.ps1 — PowerShell wrapper for ``sf project deploy start`` USAGE: - sf-deploy.ps1 -o (-s ",[,...]" | -d ) [-t ",[,...]"] - sf-deploy.ps1 -h + sf-deploy.ps1 -to (-sr ",[,...]" | -dr ) [-ts ",[,...]"] + sf-deploy.ps1 -hp OPTIONS: - -o Org alias or username for --target-org - -s Comma-separated list of --source-dir paths - -d Single directory path to deploy (alternative to -s) - -t Comma-separated list of --tests (enables --test-level RunSpecifiedTests) - -h Show this help + -to Target org alias or username for --target-org + -sr Sources - comma-separated list of --source-dir paths + -dr Directory - single directory path to deploy (alternative to -sr) + -ts Tests - comma-separated list of --tests (enables --test-level RunSpecifiedTests) + -hp Help - show this help EXAMPLES: 1) Real deploy with multiple flexipages (specific files): - sf-deploy.ps1 -o "DEMO-ORG" `` - -s "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Page_Backup_With_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml" + sf-deploy.ps1 -to "DEMO-ORG" `` + -sr "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Page_Backup_With_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml" 2) Real deploy with entire directory: - sf-deploy.ps1 -o "DEMO-ORG" -d "force-app/main/default/classes" + sf-deploy.ps1 -to "DEMO-ORG" -dr "force-app/main/default/classes" 3) Real deploy with specified tests: - sf-deploy.ps1 -o "DEMO-ORG" `` - -s "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" `` - -t "SelectorOpportunity_Test,SelectorOpportunity2_Test" + sf-deploy.ps1 -to "DEMO-ORG" `` + -sr "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" `` + -ts "SelectorOpportunity_Test,SelectorOpportunity2_Test" Notes: -- Use -s for specific files (comma-separated) OR -d for entire directories (not both). +- Use -sr for specific files (comma-separated) OR -dr for entire directories (not both). - Pass absolute or repo-relative paths. -- Multiple tests are comma-separated in -t; they will be expanded to multiple --tests flags. +- Multiple tests are comma-separated in -ts; they will be expanded to multiple --tests flags. "@ } # Show help if requested or no parameters provided -if ($h -or ($o -eq "" -and $s -eq "" -and $d -eq "" -and $t -eq "")) { +if ($hp -or ($to -eq "" -and $sr -eq "" -and $dr -eq "" -and $ts -eq "")) { Show-Help exit 0 } -# Validate that either -s or -d is provided, but not both -if ($s -ne "" -and $d -ne "") { - Write-Error "Cannot use both -s and -d options. Use -s for specific files or -d for directories." +# Validate that either -sr or -dr is provided, but not both +if ($sr -ne "" -and $dr -ne "") { + Write-Error "Cannot use both -sr and -dr options. Use -sr for specific files or -dr for directories." Write-Host "" Show-Help exit 1 } # Validate required parameters -if ($o -eq "" -or ($s -eq "" -and $d -eq "")) { - Write-Error "Must provide -o (org) and either -s (specific files) or -d (directory path)." +if ($to -eq "" -or ($sr -eq "" -and $dr -eq "")) { + Write-Error "Must provide -to (org) and either -sr (specific files) or -dr (directory path)." Write-Host "" Show-Help exit 1 @@ -94,8 +94,8 @@ catch { $cmd = @("sf", "project", "deploy", "start") # Add source directories (specific files) -if ($s -ne "") { - $sourcesArray = $s -split "," +if ($sr -ne "") { + $sourcesArray = $sr -split "," foreach ($src in $sourcesArray) { $src = $src.Trim() if ($src -ne "") { @@ -106,20 +106,20 @@ if ($s -ne "") { } # Add directory path -if ($d -ne "") { +if ($dr -ne "") { $cmd += "--source-dir" - $cmd += $d + $cmd += $dr } # Add target org -if ($o -ne "") { +if ($to -ne "") { $cmd += "--target-org" - $cmd += $o + $cmd += $to } # Add tests if specified -if ($t -ne "") { - $testsArray = $t -split "," +if ($ts -ne "") { + $testsArray = $ts -split "," $cmd += "--test-level" $cmd += "RunSpecifiedTests" diff --git a/sf-dry-run.ps1 b/sf-dry-run.ps1 index 0c808ea..f9a6f6b 100644 --- a/sf-dry-run.ps1 +++ b/sf-dry-run.ps1 @@ -1,9 +1,9 @@ param( - [string]$o = "", - [string]$s = "", - [string]$d = "", - [string]$t = "", - [switch]$h + [string]$to = "", + [string]$sr = "", + [string]$dr = "", + [string]$ts = "", + [switch]$hp ) function Show-Help { @@ -11,53 +11,53 @@ function Show-Help { sf-dry-run.ps1 — PowerShell wrapper for ``sf project deploy start --dry-run`` USAGE: - sf-dry-run.ps1 -o (-s ",[,...]" | -d ) [-t ",[,...]"] - sf-dry-run.ps1 -h + sf-dry-run.ps1 -to (-sr ",[,...]" | -dr ) [-ts ",[,...]"] + sf-dry-run.ps1 -hp OPTIONS: - -o Org alias or username for --target-org - -s Comma-separated list of --source-dir paths - -d Single directory path to validate (alternative to -s) - -t Comma-separated list of --tests (enables --test-level RunSpecifiedTests) - -h Show this help + -to Target org alias or username for --target-org + -sr Sources - comma-separated list of --source-dir paths + -dr Directory - single directory path to validate (alternative to -sr) + -ts Tests - comma-separated list of --tests (enables --test-level RunSpecifiedTests) + -hp Help - show this help EXAMPLES: 1) Basic dry-run with multiple flexipages (specific files): - sf-dry-run.ps1 -o "DEMO-ORG" `` - -s "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml" + sf-dry-run.ps1 -to "DEMO-ORG" `` + -sr "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml" 2) Dry-run validation for entire directory: - sf-dry-run.ps1 -o "DEMO-ORG" -d "force-app/main/default/classes" + sf-dry-run.ps1 -to "DEMO-ORG" -dr "force-app/main/default/classes" 3) Dry-run with specified tests: - sf-dry-run.ps1 -o "DEMO-ORG" `` - -s "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" `` - -t "SelectorOpportunity_Test,SelectorOpportunity2_Test" + sf-dry-run.ps1 -to "DEMO-ORG" `` + -sr "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" `` + -ts "SelectorOpportunity_Test,SelectorOpportunity2_Test" Notes: -- Use -s for specific files (comma-separated) OR -d for entire directories (not both). +- Use -sr for specific files (comma-separated) OR -dr for entire directories (not both). - Pass absolute or repo-relative paths. -- Multiple tests are comma-separated in -t; they will be expanded to multiple --tests flags. +- Multiple tests are comma-separated in -ts; they will be expanded to multiple --tests flags. "@ } # Show help if requested or no parameters provided -if ($h -or ($o -eq "" -and $s -eq "" -and $d -eq "" -and $t -eq "")) { +if ($hp -or ($to -eq "" -and $sr -eq "" -and $dr -eq "" -and $ts -eq "")) { Show-Help exit 0 } -# Validate that either -s or -d is provided, but not both -if ($s -ne "" -and $d -ne "") { - Write-Error "Cannot use both -s and -d options. Use -s for specific files or -d for directories." +# Validate that either -sr or -dr is provided, but not both +if ($sr -ne "" -and $dr -ne "") { + Write-Error "Cannot use both -sr and -dr options. Use -sr for specific files or -dr for directories." Write-Host "" Show-Help exit 1 } # Validate required parameters -if ($o -eq "" -or ($s -eq "" -and $d -eq "")) { - Write-Error "Must provide -o (org) and either -s (specific files) or -d (directory path)." +if ($to -eq "" -or ($sr -eq "" -and $dr -eq "")) { + Write-Error "Must provide -to (org) and either -sr (specific files) or -dr (directory path)." Write-Host "" Show-Help exit 1 @@ -94,8 +94,8 @@ catch { $cmd = @("sf", "project", "deploy", "start", "--dry-run") # Add source directories (specific files) -if ($s -ne "") { - $sourcesArray = $s -split "," +if ($sr -ne "") { + $sourcesArray = $sr -split "," foreach ($src in $sourcesArray) { $src = $src.Trim() if ($src -ne "") { @@ -106,20 +106,20 @@ if ($s -ne "") { } # Add directory path -if ($d -ne "") { +if ($dr -ne "") { $cmd += "--source-dir" - $cmd += $d + $cmd += $dr } # Add target org -if ($o -ne "") { +if ($to -ne "") { $cmd += "--target-org" - $cmd += $o + $cmd += $to } # Add tests if specified -if ($t -ne "") { - $testsArray = $t -split "," +if ($ts -ne "") { + $testsArray = $ts -split "," $cmd += "--test-level" $cmd += "RunSpecifiedTests" diff --git a/sf-org-create.ps1 b/sf-org-create.ps1 index de97097..43e8ff8 100644 --- a/sf-org-create.ps1 +++ b/sf-org-create.ps1 @@ -1,10 +1,10 @@ param( - [string]$n = "", - [int]$d = 7, - [string]$f = "", - [switch]$a, - [string]$t = "", - [switch]$h + [string]$al = "", + [int]$dd = 7, + [string]$df = "", + [switch]$st, + [string]$tp = "", + [switch]$hp ) function Show-Help { @@ -12,28 +12,28 @@ function Show-Help { sf-org-create.ps1 — wrapper for smart scratch org creation USAGE: - sf-org-create.ps1 -n [-d ] [-f ] [-a] [-t