Improve sf-org-info.ps1 user experience by showing help when no parameters provided
- Modified script to automatically display help when run without any parameters - This prevents the confusing error message that occurred when no default org was set - Users now get clear usage information instead of a command failure - Script still works correctly when any parameter is provided (-to, -list, -limits, -ve, -hp)
This commit is contained in:
@@ -43,8 +43,8 @@ param(
|
|||||||
[switch]$hp
|
[switch]$hp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Show help if requested
|
# Show help if requested or if no parameters provided
|
||||||
if ($hp) {
|
if ($hp -or (-not $to -and -not $limits -and -not $list -and -not $ve)) {
|
||||||
Get-Help $MyInvocation.MyCommand.Path -Detailed
|
Get-Help $MyInvocation.MyCommand.Path -Detailed
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user