Skip to content

Comments

Install-Dependencies before Invoke-DeployModule#4

Merged
rulasg merged 2 commits intomainfrom
bug-fix-deployment-install-dependencies
Dec 19, 2023
Merged

Install-Dependencies before Invoke-DeployModule#4
rulasg merged 2 commits intomainfrom
bug-fix-deployment-install-dependencies

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Dec 19, 2023

No description provided.

# 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

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.

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.

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.

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.
@rulasg rulasg merged commit 8ed0869 into main Dec 19, 2023
@rulasg rulasg deleted the bug-fix-deployment-install-dependencies branch December 19, 2023 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant