Skip to content

Commit 7b965ce

Browse files
committed
ci: Overwrite Get-Metadata alias with global scope
1 parent 78d28ea commit 7b965ce

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

psakeFile.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
properties {
2+
if (Get-Alias Get-Metadata -ErrorAction SilentlyContinue) {
3+
Set-Alias -Name Get-Metadata -Value BuildHelpers\Get-Metadata -Scope Global
4+
}
5+
26
& dotnet tool restore
37
$PSBPreference.General.ModuleVersion = (dotnet nbgv get-version -f json | ConvertFrom-Json).SimpleVersion
48
$PSBPreference.Build.CompileModule = $true
@@ -8,12 +12,7 @@ properties {
812
$psake.context.tasks.stagefiles.PostAction = {
913
$outputManifestPath = [io.path]::Combine($PSBPreference.Build.ModuleOutDir, "$($PSBPreference.General.ModuleName).psd1")
1014
Write-Verbose "Updating ModuleVersion in output manifest '$outputManifestPath' to NBGV-based version $($PSBPreference.General.ModuleVersion)"
11-
12-
if (Get-Alias Get-Metadata -ErrorAction SilentlyContinue) {
13-
Set-Alias -Name Get-Metadata -Value BuildHelpers\Get-Metadata
14-
}
1515
Update-Metadata -Path $outputManifestPath -Value $PSBPreference.General.ModuleVersion
16-
1716
Write-Verbose "Converting root module to UTF8 since PowerShellBuild generates a Unicode file on Windows PowerShell"
1817
Import-Module (Join-Path $env:BHProjectPath 'tests/MetaFixers.psm1')
1918
$rootModulePath = Join-Path -Path $env:BHBuildOutput -ChildPath "$($env:BHProjectName).psm1"

0 commit comments

Comments
 (0)