@@ -20,7 +20,6 @@ $script:FullyQualifiedModuleName = [Microsoft.PowerShell.Commands.ModuleSpecific
20
20
}
21
21
22
22
$script :HelpInstallationPath = Join-Path - Path $script :PowerShellGetModuleInfo.ModuleBase - ChildPath ' en-US'
23
- $script :SaveHelpPath = Join-Path - Path ([System.IO.Path ]::GetTempPath()) - ChildPath " PSGetHelp_$ ( Get-Random ) "
24
23
25
24
function GetFiles {
26
25
param (
@@ -37,14 +36,6 @@ function GetFiles {
37
36
}
38
37
39
38
Describe ' Validate PowerShellGet module help' - tags ' P1' , ' OuterLoop' {
40
- BeforeAll {
41
- $null = New-Item - Path $script :SaveHelpPath - ItemType Directory - Force
42
- }
43
-
44
- AfterAll {
45
- Remove-Item - Path $script :SaveHelpPath - Force - Recurse
46
- }
47
-
48
39
It ' Validate Update-Help for the PowerShellGet module' {
49
40
$UpdateHelp_Params = @ {
50
41
Force = $true
@@ -72,18 +63,21 @@ Describe 'Validate PowerShellGet module help' -tags 'P1', 'OuterLoop' {
72
63
$FindModuleCommandHelp.Examples | Should Not BeNullOrEmpty
73
64
}
74
65
66
+ $helpPath = Join-Path - Path $TestDrive - ChildPath PSGetHelp
67
+ New-Item - Path $helpPath - ItemType Directory
68
+
75
69
It ' Validate Save-Help for the PowerShellGet module' {
76
70
if ($PSVersionTable.PSVersion -gt ' 4.0.0' ) {
77
- Save-Help - FullyQualifiedModule $script :FullyQualifiedModuleName - Force - UICulture en- US - DestinationPath $script :SaveHelpPath
71
+ Save-Help - FullyQualifiedModule $script :FullyQualifiedModuleName - Force - UICulture en- US - DestinationPath $helpPath
78
72
}
79
73
else {
80
- Save-Help - Module PowerShellGet - Force - UICulture en- US - DestinationPath $script :SaveHelpPath
74
+ Save-Help - Module PowerShellGet - Force - UICulture en- US - DestinationPath $helpPath
81
75
}
82
76
83
- $compressedFile = GetFiles - Include " *$script :HelpContentExtension " - Path $script :SaveHelpPath | ForEach-Object {Split-Path - Path $_ - Leaf}
77
+ $compressedFile = GetFiles - Include " *$script :HelpContentExtension " - Path $helpPath | ForEach-Object { Split-Path - Path $_ - Leaf }
84
78
$compressedFile | Should Be $script :ExpectedCompressedFile
85
-
86
- $helpFilesSaved = GetFiles - Include " *HelpInfo.xml" - Path $script :SaveHelpPath | ForEach-Object {Split-Path - Path $_ - Leaf}
79
+
80
+ $helpFilesSaved = GetFiles - Include " *HelpInfo.xml" - Path $helpPath | ForEach-Object { Split-Path - Path $_ - Leaf }
87
81
$helpFilesSaved | Should Be $script :ExpectedHelpInfoFile
88
82
}
89
83
}
0 commit comments