Skip to content

Commit

Permalink
Update logging module to bootstrap script
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Sep 2, 2020
1 parent b26ee46 commit a800817
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions actions_bootstrap.ps1
Expand Up @@ -30,6 +30,11 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{
ModuleVersion = '0.12.0'
}))

$null = $modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Logging'
ModuleVersion = '4.4.0'
}))

'Installing PowerShell Modules'
foreach ($module in $modulesToInstall) {
$installSplat = @{
Expand All @@ -43,10 +48,9 @@ foreach ($module in $modulesToInstall) {
Install-Module @installSplat
Import-Module -Name $module.ModuleName -ErrorAction Stop
' - Successfully installed {0}' -f $module.ModuleName
}
catch {
} catch {
$message = 'Failed to install {0}' -f $module.ModuleName
" - $message"
throw $message
}
}
}
5 changes: 2 additions & 3 deletions azure-pipelines.yml
Expand Up @@ -11,7 +11,6 @@ jobs:
- pwsh: |
$PSVersionTable
.\actions_bootstrap.ps1
Install-Module Logging -RequiredVersion 4.4.0 -Force
Invoke-Build -File $(Build.SourcesDirectory)\src\Javinizer.build.ps1
displayName: 'Build and Test - Windows pwsh'
- task: PublishTestResults@2
Expand All @@ -36,7 +35,7 @@ jobs:
sudo apt-get install -f
displayName: 'Install PowerShell Core'
- script: |
pwsh -c 'Install-Module Logging -RequiredVersion 4.4.0 -Force;$PSVersionTable;.\actions_bootstrap.ps1;Invoke-Build -File $(Build.SourcesDirectory)/src/Javinizer.build.ps1'
pwsh -c '$PSVersionTable;.\actions_bootstrap.ps1;Invoke-Build -File $(Build.SourcesDirectory)/src/Javinizer.build.ps1'
displayName: 'Build and Test - Linux'
- task: PublishTestResults@2
inputs:
Expand All @@ -55,7 +54,7 @@ jobs:
brew cask install powershell
displayName: 'Install PowerShell Core'
- script: |
pwsh -c 'Install-Module Logging -RequiredVersion 4.4.0 -Force;$PSVersionTable;.\actions_bootstrap.ps1;Invoke-Build -File $(Build.SourcesDirectory)/src/Javinizer.build.ps1'
pwsh -c '$PSVersionTable;.\actions_bootstrap.ps1;Invoke-Build -File $(Build.SourcesDirectory)/src/Javinizer.build.ps1'
displayName: 'Build and Test'
- task: PublishTestResults@2
inputs:
Expand Down

0 comments on commit a800817

Please sign in to comment.