Skip to content

Commit 1c4e48a

Browse files
find and copy nupkg
1 parent 0b8f3e9 commit 1c4e48a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.pipelines/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,13 @@ extends:
146146
inputs:
147147
targetType: inline
148148
script: |
149-
$null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)\release"
150-
Copy-Item "$(Pipeline.Workspace)\Microsoft.PowerShell.*.nupkg" -Destination "$(Pipeline.Workspace)\release" -Recurse -Force -Verbose
149+
$DestPath = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)\release"
150+
$nupkgFile = Get-ChildItem "$(Pipeline.Workspace)\Microsoft.PowerShell.Native.*.nupkg" -Recurse
151+
if (-not $nupkgFile) {
152+
throw "No nupkg files found in '$(Pipeline.Workspace)'"
153+
}
154+
155+
Copy-Item $nupkgFile -Destination $DestPath -Recurse -Force -Verbose
151156
Write-Verbose -Verbose "The .nupkgs below will be pushed:"
152157
Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
153158
displayName: Download and capture nupkgs

0 commit comments

Comments
 (0)