-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy path.test.ps1
37 lines (32 loc) · 793 Bytes
/
.test.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
$Version = $PSVersionTable.PSVersion.Major
task Test1 {
($r = try {.\Test1.ps1} catch {$_})
if ($Version -eq 2) {
equals $r.FullyQualifiedErrorId 'Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.ImportModuleCommand'
}
else {
equals $r Something
}
}
task Test2 {
($r = .\Test2.ps1)
equals $r Something
}
task Test3 {
($r = try {.\Test3.ps1} catch {$_})
if ($Version -eq 2) {
equals $r.FullyQualifiedErrorId 'Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.ImportModuleCommand'
}
else {
equals $r Something
}
}
task Test4 {
($r = try {.\Test4.ps1} catch {$_})
if ($Version -eq 2) {
equals $r.FullyQualifiedErrorId 'Modules_InsufficientPowerShellVersion,Microsoft.PowerShell.Commands.ImportModuleCommand'
}
else {
equals $r Something
}
}