Fix PowerShell help function
- Replace problematic Get-Help call with simple Write-Host statements - Ensures help works in all PowerShell execution contexts - Maintains consistent help format with other scripts - Tested successfully on PowerShell Core 7.5.2
This commit is contained in:
@@ -48,7 +48,21 @@ param(
|
||||
)
|
||||
|
||||
function Show-Help {
|
||||
Get-Help $MyInvocation.MyCommand.Path -Detailed
|
||||
Write-Host "sf-org-lic.ps1 - Salesforce org license utilization reporting tool"
|
||||
Write-Host ""
|
||||
Write-Host "Usage: .\\sf-org-lic.ps1 -to <ORG_ALIAS> [-hp]"
|
||||
Write-Host ""
|
||||
Write-Host "Generate comprehensive Salesforce license utilization reports for an org."
|
||||
Write-Host "Reports on User Licenses and Permission Set Licenses with detailed totals."
|
||||
Write-Host ""
|
||||
Write-Host "Parameters:"
|
||||
Write-Host " -to Target org alias or username (required)"
|
||||
Write-Host " -hp Show this help message"
|
||||
Write-Host ""
|
||||
Write-Host "Examples:"
|
||||
Write-Host " .\\sf-org-lic.ps1 -to \"PROD-ORG\""
|
||||
Write-Host " .\\sf-org-lic.ps1 -to \"admin@company.com\""
|
||||
Write-Host " .\\sf-org-lic.ps1 -hp"
|
||||
}
|
||||
|
||||
function Write-Error-And-Exit {
|
||||
|
||||
Reference in New Issue
Block a user