installation of dependencies moved to ps function

This commit is contained in:
OCram85 2017-10-23 10:22:11 +02:00
parent 6e9cc439fd
commit 455bb662a4
2 changed files with 27 additions and 8 deletions

View File

@ -14,15 +14,8 @@ image: Visual Studio 2017
# Install pester module and init the Appveyor support.
install:
- ps: Install-PackageProvider -Name NuGet -MinimumVersion '2.8.5.201' -Force -Verbose
- ps: Import-PackageProvider NuGet -MinimumVersion '2.8.5.201' -Force
- ps: Install-Module -Name 'Pester' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
- ps: Update-Module 'Pester'
- ps: Install-Module -Name 'posh-git' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
- ps: Update-Module 'posh-git'
- ps: Install-Module -Name 'PSCoverage' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
- ps: Import-Module 'PSCoverage'
- ps: Import-Module .\tools\AppVeyor.psm1
- ps: Invoke-InstallDependencies
environment:
NuGetToken:

View File

@ -9,6 +9,32 @@
$CALLSIGN = 'PSCredentialStore'
Write-Host ("Callsign is: {0}" -f $CALLSIGN) -ForegroundColor Yellow
Function Invoke-InstallDependencies() {
[CmdletBinding()]
Param()
Process {
Try {
Install-PackageProvider -Name NuGet -RequiredVersion '2.8.5.208' -Force -Verbose
Import-PackageProvider -Name NuGet -RequiredVersion '2.8.5.208' -Force
Install-Module -Name 'Pester' -Scope CurrentUser -RequiredVersion '4.0.8' -Force -SkipPublisherCheck -AllowClobber
Install-Module -Name 'posh-git' -Scope CurrentUser -RequiredVersion '0.7.1' -Force -SkipPublisherCheck -AllowClobber
Install-Module -Name 'PSCoverage' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
Import-Module -Name 'Pester', 'posh-git', 'PSCoverage'
}
Catch {
$MsgParams = @{
Message = 'Could not install the required dependencies!'
Category = 'Error'
Details = $_.Exception.Message
}
Add-AppveyorMessage @MsgParams
Throw $MsgParams.Message
}
}
}
Function Invoke-AppVeyorBumpVersion() {
[CmdletBinding()]
Param()