Update PowerShell scripts to use consistent two-character options (Part 1)
🔄 PowerShell Option Consistency - Phase 1 Complete: ✅ Updated Scripts: - sf-deploy.ps1: -to, -sr, -dr, -ts, -hp (matches Bash) - sf-dry-run.ps1: -to, -sr, -dr, -ts, -hp (matches Bash) - sf-web-open.ps1: -to, -pt, -ur, -hp (matches Bash) - sf-check.ps1: -vb, -hp (matches Bash) - sf-org-create.ps1: -al, -dd, -df, -st, -tp, -hp (matches Bash) 🎯 Consistency Achieved: - All parameter names now match their Bash counterparts exactly - Help text updated with descriptive option names - Examples updated to show new two-character options - All validation logic updated to use new parameter names 🚀 Cross-Platform Alignment: - PowerShell and Bash scripts now have identical option schemes - Users get consistent experience across platforms - No more confusion between single-char and two-char options Remaining: 7 more PowerShell scripts to update for full consistency.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
param(
|
||||
[string]$o = "",
|
||||
[string]$p = "",
|
||||
[switch]$U,
|
||||
[switch]$h
|
||||
[string]$to = "",
|
||||
[string]$pt = "",
|
||||
[switch]$ur,
|
||||
[switch]$hp
|
||||
)
|
||||
|
||||
function Show-Help {
|
||||
@@ -10,38 +10,38 @@ function Show-Help {
|
||||
sf-web-open.ps1 — PowerShell wrapper for ``sf org open``
|
||||
|
||||
USAGE:
|
||||
sf-web-open.ps1 [-o <ORG_ALIAS_OR_USERNAME>] [-p <RELATIVE_PATH>] [-U]
|
||||
sf-web-open.ps1 -h
|
||||
sf-web-open.ps1 [-to <ORG_ALIAS_OR_USERNAME>] [-pt <RELATIVE_PATH>] [-ur]
|
||||
sf-web-open.ps1 -hp
|
||||
|
||||
OPTIONS:
|
||||
-o Org alias or username to pass as --target-org
|
||||
-p Relative path to open inside the org (e.g., "/lightning/setup/SetupOneHome/home")
|
||||
-U URL-only: print the URL instead of opening a browser (passes --url-only)
|
||||
-h Show this help
|
||||
-to Target org alias or username to pass as --target-org
|
||||
-pt Path - relative path to open inside the org (e.g., "/lightning/setup/SetupOneHome/home")
|
||||
-ur URL-only: print the URL instead of opening a browser (passes --url-only)
|
||||
-hp Help - show this help
|
||||
|
||||
EXAMPLES:
|
||||
1) Open a specific org (default home):
|
||||
sf-web-open.ps1 -o "DEMO-ORG"
|
||||
sf-web-open.ps1 -to "DEMO-ORG"
|
||||
|
||||
2) Open Setup Home of a target org:
|
||||
sf-web-open.ps1 -o "NUSHUB-DR2" -p "/lightning/setup/SetupOneHome/home"
|
||||
sf-web-open.ps1 -to "NUSHUB-DR2" -pt "/lightning/setup/SetupOneHome/home"
|
||||
|
||||
3) Get just the URL for scripting:
|
||||
sf-web-open.ps1 -o "NUSHUB-DR2" -U
|
||||
sf-web-open.ps1 -to "NUSHUB-DR2" -ur
|
||||
|
||||
4) Open the current default org (no -o provided):
|
||||
4) Open the current default org (no -to provided):
|
||||
sf-web-open.ps1
|
||||
"@
|
||||
}
|
||||
|
||||
# Show help if requested
|
||||
if ($h) {
|
||||
if ($hp) {
|
||||
Show-Help
|
||||
exit 0
|
||||
}
|
||||
|
||||
# If no parameters provided, show help and examples
|
||||
if ($o -eq "" -and $p -eq "" -and -not $U) {
|
||||
if ($to -eq "" -and $pt -eq "" -and -not $ur) {
|
||||
Show-Help
|
||||
exit 0
|
||||
}
|
||||
@@ -77,19 +77,19 @@ catch {
|
||||
$cmd = @("sf", "org", "open")
|
||||
|
||||
# Add target org if specified
|
||||
if ($o -ne "") {
|
||||
if ($to -ne "") {
|
||||
$cmd += "--target-org"
|
||||
$cmd += $o
|
||||
$cmd += $to
|
||||
}
|
||||
|
||||
# Add path if specified
|
||||
if ($p -ne "") {
|
||||
if ($pt -ne "") {
|
||||
$cmd += "--path"
|
||||
$cmd += $p
|
||||
$cmd += $pt
|
||||
}
|
||||
|
||||
# Add URL-only flag if specified
|
||||
if ($U) {
|
||||
if ($ur) {
|
||||
$cmd += "--url-only"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user