-
-
Notifications
You must be signed in to change notification settings - Fork 0
Aadd Salesforce CLI installation function #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -1,31 +1,16 @@ | |||
| Write-Information -Message ("Loading {0} ..." -f ($PSCommandPath | Split-Path -LeafBase)) -InformationAction continue | |||
| Write-Information -Message ("Loading {0} ..." -f ($PSScriptRoot | Split-Path -Leaf)) -InformationAction continue | |||
Check warning
Code scanning / PSScriptAnalyzer
Cmdlet 'Write-Information' may be used incorrectly. Please check that all mandatory parameters are supplied. Warning
|
|
||
| function Write-MyError{ | ||
| param( | ||
| [Parameter(Mandatory,ValueFromPipeline)][string]$Message |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| param( | ||
| [Parameter(Mandatory,ValueFromPipeline)][string]$Message | ||
| ) | ||
| Write-Host "Error: $message" -ForegroundColor $ERROR_COLOR |
Check warning
Code scanning / PSScriptAnalyzer
File 'MyWrite.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
|
|
||
| function Write-MyWarning{ | ||
| param( | ||
| [Parameter(Mandatory,ValueFromPipeline)][string]$Message |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| param( | ||
| [Parameter(Mandatory,ValueFromPipeline)][string]$Message | ||
| ) | ||
| Write-Host "Error: $message" -ForegroundColor $WARNING_COLOR |
Check warning
Code scanning / PSScriptAnalyzer
File 'MyWrite.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
|
|
||
| function Write-MyVerbose{ | ||
| param( | ||
| [Parameter(ValueFromPipeline)][string]$Message |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
|
|
||
| function Write-MyHost{ | ||
| param( | ||
| [Parameter(ValueFromPipeline)][string]$Message |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| param( | ||
| [Parameter(ValueFromPipeline)][string]$Message | ||
| ) | ||
| Write-Host $message -ForegroundColor $OUTPUT_COLOR |
Check warning
Code scanning / PSScriptAnalyzer
File 'MyWrite.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| Set-MyInvokeCommandAlias -Alias GetNpmVersion -Command "npm --version" | ||
| Set-MyInvokeCommandAlias -Alias SalesforceCliInstall -Command "npm install @salesforce/cli --global" | ||
|
|
||
| function Install-SalesforceClient{ |
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Install-SalesforceClient' does not have a help comment. Note
Refactor the file loading mechanism for improved clarity and efficiency. Introduce a new function to install the Salesforce CLI via npm, along with custom logging functions for better error handling and messaging. Export the new installation function for module usage.