@@ -32,7 +32,6 @@ $script:IsNix = $IsLinux -or $IsMacOS
32
32
$script :IsRosetta = $IsMacOS -and (sysctl - n sysctl.proc_translated) -eq 1 # Mac M1
33
33
$script :BuildInfoPath = [System.IO.Path ]::Combine($PSScriptRoot , " src" , " PowerShellEditorServices.Hosting" , " BuildInfo.cs" )
34
34
$script :PsesCommonProps = [xml ](Get-Content - Raw " $PSScriptRoot /PowerShellEditorServices.Common.props" )
35
- $script :IsPreview = [bool ]($script :PsesCommonProps.Project.PropertyGroup.VersionSuffix )
36
35
37
36
$script :NetRuntime = @ {
38
37
PS7 = ' netcoreapp3.1'
@@ -341,15 +340,13 @@ task RestorePsesModules -After Build {
341
340
$name = $_.Name
342
341
$body = @ {
343
342
Name = $name
344
- MinimumVersion = $_.Value.MinimumVersion
345
- MaximumVersion = $_.Value.MaximumVersion
346
- AllowPrerelease = $script :IsPreview
343
+ Version = $_.Value.Version
344
+ AllowPrerelease = $_.Value.AllowPrerelease
347
345
Repository = if ($_.Value.Repository ) { $_.Value.Repository } else { $DefaultModuleRepository }
348
346
Path = $submodulePath
349
347
}
350
348
351
- if (-not $name )
352
- {
349
+ if (-not $name ) {
353
350
throw " EditorServices module listed without name in '$ModulesJsonPath '"
354
351
}
355
352
@@ -364,10 +361,8 @@ task RestorePsesModules -After Build {
364
361
}
365
362
366
363
# Save each module in the modules.json file
367
- foreach ($moduleName in $moduleInfos.Keys )
368
- {
369
- if (Test-Path - Path (Join-Path - Path $submodulePath - ChildPath $moduleName ))
370
- {
364
+ foreach ($moduleName in $moduleInfos.Keys ) {
365
+ if (Test-Path - Path (Join-Path - Path $submodulePath - ChildPath $moduleName )) {
371
366
Write-Host " `t Module '${moduleName} ' already detected. Skipping"
372
367
continue
373
368
}
@@ -376,18 +371,12 @@ task RestorePsesModules -After Build {
376
371
377
372
$splatParameters = @ {
378
373
Name = $moduleName
374
+ RequiredVersion = $moduleInstallDetails.Version
379
375
AllowPrerelease = $moduleInstallDetails.AllowPrerelease
380
376
Repository = if ($moduleInstallDetails.Repository ) { $moduleInstallDetails.Repository } else { $DefaultModuleRepository }
381
377
Path = $submodulePath
382
378
}
383
379
384
- # Only add Min and Max version if we're doing a stable release.
385
- # This is due to a PSGet issue with AllowPrerelease not installing the latest preview.
386
- if (! $moduleInstallDetails.AllowPrerelease ) {
387
- $splatParameters.MinimumVersion = $moduleInstallDetails.MinimumVersion
388
- $splatParameters.MaximumVersion = $moduleInstallDetails.MaximumVersion
389
- }
390
-
391
380
Write-Host " `t Installing module: ${moduleName} with arguments $ ( ConvertTo-Json $splatParameters ) "
392
381
393
382
Save-Module @splatParameters
0 commit comments