Skip to content

Commit

Permalink
Using latest build pattern so Prism gets installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
splatteredbits committed Feb 18, 2023
1 parent 2a02b05 commit 7c6bfab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 45 deletions.
14 changes: 10 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@ for:
only:
- job_group: ps
build_script:
- ps: .\init.ps1 -SqlServerName "$($env:MSSQL_INSTANCE_NAME)"
- ps: .\build.ps1
- ps: |
$ProgressPreference = 'SilentlyContinue'
iwr https://raw.githubusercontent.com/webmd-health-services/Prism/main/Scripts/init.ps1 | iex | Format-Table
.\init.ps1 -SqlServerName "$($env:MSSQL_INSTANCE_NAME)"
.\build.ps1
# Build in PowerShell
- matrix:
only:
- job_group: pwsh
build_script:
- pwsh: ./init.ps1 -SqlServerName "$($env:MSSQL_INSTANCE_NAME)"
- pwsh: ./build.ps1
- pwsh: |
$ProgressPreference = 'SilentlyContinue'
iwr https://raw.githubusercontent.com/webmd-health-services/Prism/main/Scripts/init.ps1 | iex | Format-Table
./init.ps1 -SqlServerName "$($env:MSSQL_INSTANCE_NAME)"
./build.ps1
41 changes: 0 additions & 41 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,3 @@ Set-StrictMode -Version 'Latest'
$InformationPreference = 'Continue'

$SqlServerName | Set-Content -Path 'Test\Server.txt'

# Run in a background job so that old PackageManagement assemblies don't get loaded.
$job = Start-Job {
$InformationPreference = 'Continue'
$psGalleryRepo = Get-PSRepository -Name 'PSGallery'
$repoToUse = $psGalleryRepo.Name
# On Windows 2012 R2, Windows PowerShell 5.1, and .NET 4.6.2, PSGallery's URL ends with a '/'.
if( -not $psGalleryRepo -or $psgalleryRepo.SourceLocation -ne 'https://www.powershellgallery.com/api/v2' )
{
$repoToUse = 'PSGallery2'
Register-PSRepository -Name $repoToUse `
-InstallationPolicy Trusted `
-SourceLocation 'https://www.powershellgallery.com/api/v2' `
-PackageManagementProvider $psGalleryRepo.PackageManagementProvider
}

Write-Information -MessageData 'Installing latest version of PowerShell module Prism.'
Install-Module -Name 'Prism' -Scope CurrentUser -Repository $repoToUse -AllowClobber -Force

if( -not (Get-Module -Name 'PackageManagement' -ListAvailable | Where-Object 'Version' -eq '1.4.7') )
{
Write-Information -MessageData 'Installing PowerShell module PackageManagement 1.4.7.'
Install-Module -Name 'PackageManagement' -RequiredVersion '1.4.7'-Repository $repoToUse -AllowClobber -Force
}

if( -not (Get-Module -Name 'PowerShellGet' -ListAvailable | Where-Object 'Version' -eq '2.2.5') )
{
Write-Information -MessageData 'Installing PowerShell module PowerShellGet 2.2.5.'
Install-Module -Name 'PowerShellGet' -RequiredVersion '2.2.5' -Repository $repoToUse -AllowClobber -Force
}
}

if( (Get-Command -Name 'Receive-Job' -ParameterName 'AutoRemoveJob') )
{
$job | Receive-Job -AutoRemoveJob -Wait
}
else
{
$job | Wait-Job | Receive-Job
$job | Remove-Job
}

0 comments on commit 7c6bfab

Please sign in to comment.