@@ -32,7 +32,6 @@ $script:IsNix = $IsLinux -or $IsMacOS
3232$script :IsRosetta = $IsMacOS -and (sysctl - n sysctl.proc_translated) -eq 1 # Mac M1
3333$script :BuildInfoPath = [System.IO.Path ]::Combine($PSScriptRoot , " src" , " PowerShellEditorServices.Hosting" , " BuildInfo.cs" )
3434$script :PsesCommonProps = [xml ](Get-Content - Raw " $PSScriptRoot /PowerShellEditorServices.Common.props" )
35- $script :IsPreview = [bool ]($script :PsesCommonProps.Project.PropertyGroup.VersionSuffix )
3635
3736$script :NetRuntime = @ {
3837 PS7 = ' netcoreapp3.1'
@@ -341,15 +340,13 @@ task RestorePsesModules -After Build {
341340 $name = $_.Name
342341 $body = @ {
343342 Name = $name
344- MinimumVersion = $_.Value.MinimumVersion
345- MaximumVersion = $_.Value.MaximumVersion
346- AllowPrerelease = $script :IsPreview
343+ Version = $_.Value.Version
344+ AllowPrerelease = $_.Value.AllowPrerelease
347345 Repository = if ($_.Value.Repository ) { $_.Value.Repository } else { $DefaultModuleRepository }
348346 Path = $submodulePath
349347 }
350348
351- if (-not $name )
352- {
349+ if (-not $name ) {
353350 throw " EditorServices module listed without name in '$ModulesJsonPath '"
354351 }
355352
@@ -364,10 +361,8 @@ task RestorePsesModules -After Build {
364361 }
365362
366363 # 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 )) {
371366 Write-Host " `t Module '${moduleName} ' already detected. Skipping"
372367 continue
373368 }
@@ -376,18 +371,12 @@ task RestorePsesModules -After Build {
376371
377372 $splatParameters = @ {
378373 Name = $moduleName
374+ RequiredVersion = $moduleInstallDetails.Version
379375 AllowPrerelease = $moduleInstallDetails.AllowPrerelease
380376 Repository = if ($moduleInstallDetails.Repository ) { $moduleInstallDetails.Repository } else { $DefaultModuleRepository }
381377 Path = $submodulePath
382378 }
383379
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-
391380 Write-Host " `t Installing module: ${moduleName} with arguments $ ( ConvertTo-Json $splatParameters ) "
392381
393382 Save-Module @splatParameters
0 commit comments