Install-Dependencies before Invoke-DeployModule#4
Conversation
| # During testing we should use -WhatIf paarmetre when calling for deploy. | ||
| # Just reach this point when testing call failure | ||
|
|
||
| ## Install delendecies as Publish-Module |
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace
| } | ||
| } | ||
|
|
||
| function Install-Dependencies{ |
Check warning
Code scanning / PSScriptAnalyzer
The cmdlet 'Install-Dependencies' uses a plural noun. A singular noun should be used instead.
| $module = Import-Module -Name $requiredModule -PassThru -ErrorAction SilentlyContinue | ||
|
|
||
| if ($null -eq $module) { | ||
| "Installing module $requiredModule" | Write-Host -ForegroundColor DarkGray |
Check warning
Code scanning / PSScriptAnalyzer
File 'deploy.Helper.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.
| "Installing module $requiredModule" | Write-Host -ForegroundColor DarkGray | ||
| Install-Module -Name $requiredModule -Force -AllowPrerelease | ||
| $module = Import-Module -Name $requiredModule -PassThru | ||
| "Loaded module Name[$($module.Name)] Version[$($module.Version)]" | Write-Host -ForegroundColor DarkGray |
Check warning
Code scanning / PSScriptAnalyzer
File 'deploy.Helper.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.
No description provided.