-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathInstallAz.Tests.ps1
40 lines (30 loc) · 1.13 KB
/
InstallAz.Tests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
$ProgressPreference = "SilentlyContinue"
$modPath = "$psscriptroot/../PSGetTestUtils.psm1"
Import-Module $modPath -Force -Verbose
$psmodulePaths = $env:PSModulePath -split ';'
Write-Verbose -Verbose "Current module search paths: $psmodulePaths"
Describe 'Test Install-PSResource for the Az module' -tags 'CI' {
BeforeAll {
$PSGalleryName = Get-PSGalleryName
$azName = "Az"
$azDepWildCard = "Az.*"
Get-NewPSResourceRepositoryFile
}
AfterEach {
Uninstall-PSResource $azName, $azDepWildCard -ErrorAction SilentlyContinue
}
AfterAll {
Get-RevertPSResourceRepositoryFile
}
It "Install Az module and all dependencies" -Pending {
Install-PSResource -Name $azName -Repository $PSGalleryName -TrustRepository -Reinstall
$pkg = Get-InstalledPSResource $azName
$pkg | Should -Not -BeNullOrEmpty
$pkg.Name | Should -Be $azName
$dep = Get-InstalledPSResource $azDepWildCard
$dep | Should -Not -BeNullOrEmpty
$dep.Count | Should -BeGreaterThan 70
}
}