Tests/Install-Module.tests.ps1
# Import PesterHelper Class . (Join-Path -Path $PSScriptRoot -ChildPath 'PesterHelper.class.ps1') # Load PesterHelper Environement $PesterHelper = [PesterHelper]::new() $PesterHelper.LoadModule() # Pester Test Describe "Install-Module" { # Setup Virtualenv Initialize-Virtualenv Enable-Virtualenv It "Should be install Pester module" { Install-Module -Name Pester "$($PesterHelper.TmpLocation)\venv\Pester" | Should -Exist } It "Should be install Pester module with RequiredVersion parameter" { Install-Module -Name Pester -RequiredVersion '4.3.1' "$($PesterHelper.TmpLocation)\venv\Pester\4.3.1" | Should -Exist } It "Should be install Pester module with MaximumVersion parameter" { Install-Module -Name Pester -MaximumVersion '4.2.1' "$($PesterHelper.TmpLocation)\venv\Pester\4.2.0" | Should -Exist } } # Unload PesterHelper Environement $PesterHelper.UnloadModule() |