You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plaster/ModuleBuild/scaffold/modulename.build.template
+10-26Lines changed: 10 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -51,38 +51,22 @@ task ValidateRequirements {
51
51
assert ($PSVersionTable.PSVersion.Major.ToString() -eq '5') 'Powershell 5 is required for this build to function properly (you can comment this assert out if you are able to work around this requirement)'
52
52
}
53
53
54
-
#Synopsis: Load required modules if available. Otherwise try to install, then load it.
54
+
#Synopsis: Load required build modules using PSDepend
55
55
task LoadRequiredModules {
56
56
Write-Description White 'Loading all required modules for the build framework' -accent
57
57
58
-
# These are required for a full build process and will be automatically installed if they aren't available
59
-
$Script:RequiredModules = @('PlatyPS')
60
-
61
-
# Some optional modules
62
-
if ($Script:BuildEnv.OptionAnalyzeCode) {
63
-
$Script:RequiredModules += 'PSScriptAnalyzer'
64
-
}
65
-
if ($Script:BuildEnv.OptionGenerateReadTheDocs) {
66
-
$Script:RequiredModules += 'Powershell-YAML'
67
-
}
68
-
if ($Script:BuildEnv.OptionCodeHealthReport) {
69
-
$Script:RequiredModules += 'PSCodeHealth'
70
-
}
71
-
$Script:RequiredModules | Foreach-Object {
72
-
if ((get-module $_ -ListAvailable) -eq $null) {
73
-
Write-Description White "Installing $($_) Module" -Level 2
74
-
$null = Install-Module $_ -Scope:CurrentUser
75
-
}
76
-
if (get-module $_ -ListAvailable) {
77
-
Write-Description White "Importing $($_) Module" -Level 2
78
-
Import-Module $_ -Force
79
-
}
80
-
else {
81
-
throw 'How did you even get here?'
82
-
}
58
+
if ((Get-Module PSDepend -ListAvailable) -eq $null) {
59
+
Write-Description White "Installing PSDepend Module" -Level 2
0 commit comments