@@ -23,8 +23,6 @@ $SCRIPT:ErrorActionPreference = 'Stop'
23
23
# region Prerequisites
24
24
25
25
task Prerequisites {
26
- [CmdletBinding ()] # This is just so we have access to $PSCmdlet
27
- param ()
28
26
# We want all prereqs to run so we can tell the user everything they are missing, rather than them having to fix/check/fix/check/etc.
29
27
$requirements = Import-PowerShellDataFile - Path $RequirementsManifest
30
28
$ErrorActionPreference = ' Continue'
@@ -36,7 +34,7 @@ task Prerequisites {
36
34
37
35
if ($preRequisiteIssues ) {
38
36
Write-Warning ' The following prerequisites are not met. Please install them before continuing. Setup guidance can be found here: https://github.com/PowerShell/vscode-powershell/blob/main/docs/development.md'
39
- $preRequisiteIssues | ForEach-Object { $PSCmdlet .WriteError ( $_ ) }
37
+ $preRequisiteIssues
40
38
exit 1
41
39
}
42
40
# We dont need to test for vscode anymore because we download it dynamically during the build.
@@ -46,10 +44,6 @@ task Prerequisites {
46
44
function Assert-Pwsh ([Version ]$RequiredPowerShellVersion ) {
47
45
$ErrorActionPreference = ' Continue'
48
46
try {
49
- if ($isLinux ) {
50
- Write-Host - Fore Magenta " pwsh which: $ ( which pwsh) "
51
- }
52
- Write-Host - Fore Magenta " pwsh command: $ ( Get-Command pwsh) "
53
47
[Version ]$pwshVersion = (& pwsh - v) -replace ' ^PowerShell '
54
48
} catch {
55
49
if ($InstallPrerequisites ) {
@@ -81,7 +75,12 @@ function Assert-NodeVersion ([Version]$RequiredNodeVersion) {
81
75
Write-Debug " PREREQUISITE: Detected supported Node.js version $nodeVersion at or above minimum $RequiredNodeVersion "
82
76
}
83
77
84
- function Assert-Module ([ModuleSpecification []]$RequiredModules ) {
78
+ function Assert-Module {
79
+ [CmdletBinding ()]
80
+ param (
81
+ [ModuleSpecification []]$RequiredModules
82
+ )
83
+
85
84
$ErrorActionPreference = ' Continue'
86
85
foreach ($moduleSpec in $RequiredModules ) {
87
86
Write-Debug " PREREQUISITE: Checking for module $ ( $moduleSpec.Name ) $ ( $moduleSpec.RequiredVersion ) "
@@ -91,6 +90,7 @@ function Assert-Module ([ModuleSpecification[]]$RequiredModules) {
91
90
92
91
if (-not $moduleMatch ) {
93
92
if ($InstallPrerequisites ) {
93
+ # We want to install the module in both Windows PowerShell and PowerShell for testing.
94
94
if ($isWindows -or $PSVersionTable.PSEdition -eq ' Desktop' ) {
95
95
$otherPowershell = if ($PSVersionTable.PSVersion -lt ' 6.0.0' ) {
96
96
' pwsh'
0 commit comments