forked from nightroman/PowerShellTraps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.test.ps1
53 lines (46 loc) · 938 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$v2 = $PSVersionTable.PSVersion.Major -eq 2
task Test-1.GetItemWithDrive {
$r = try {
.\Test-1.GetItemWithDrive.ps1
}
catch {
$_.FullyQualifiedErrorId
}
($r = $r -join '|')
if ($v2) {
equals $r 'C:\|HKEY_CURRENT_USER|Argument,Microsoft.PowerShell.Commands.GetItemCommand'
}
else {
equals $r 'C:\|HKEY_CURRENT_USER|True'
}
}
task Test-2.GetItemWithDot {
$r = try {
.\Test-2.GetItemWithDot.ps1
}
catch {
$_.FullyQualifiedErrorId
}
($r = $r -join '|')
if ($v2) {
equals $r 'C:\|HKEY_CURRENT_USER|Argument,Microsoft.PowerShell.Commands.GetItemCommand'
}
else {
equals $r 'C:\|HKEY_CURRENT_USER|True'
}
}
task Test-3.GetItemWithSlash {
$r = try {
.\Test-3.GetItemWithSlash.ps1
}
catch {
$_.FullyQualifiedErrorId
}
($r = $r -join '|')
if ($v2) {
equals $r 'C:\|HKEY_CURRENT_USER|Argument,Microsoft.PowerShell.Commands.GetItemCommand'
}
else {
equals $r 'C:\|HKEY_CURRENT_USER|True'
}
}