From 9c5c1964f83eafadf06bcc1d504ac9cdf154382b Mon Sep 17 00:00:00 2001 From: app Date: Mon, 1 Sep 2025 23:49:47 +0800 Subject: [PATCH] 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 --- sf-org-lic.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sf-org-lic.ps1 b/sf-org-lic.ps1 index 54cb066..2f55ee1 100644 --- a/sf-org-lic.ps1 +++ b/sf-org-lic.ps1 @@ -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 [-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 {