mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 01:34:19 +08:00
Delete the msix blob if it's already there (#24353)
This commit is contained in:
parent
8b231fb49b
commit
14c82b568a
@ -104,8 +104,14 @@ jobs:
|
||||
if ($env:BundleDir) {
|
||||
$bundleFile = Get-Item "$env:BundleDir\*.msixbundle"
|
||||
$blobName = $bundleFile | Split-Path -Leaf
|
||||
$existing = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $storageContext -ErrorAction Ignore
|
||||
if ($existing) {
|
||||
Write-Verbose -Verbose "MSIX bundle already exists at '$storageAccount/$containerName/$blobName', removing first."
|
||||
$existingBlob | Remove-AzStorageBlob -ErrorAction Stop -Verbose
|
||||
}
|
||||
|
||||
Write-Verbose -Verbose "Uploading $bundleFile to $containerName/$blobName"
|
||||
Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext
|
||||
Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext -Force
|
||||
}
|
||||
else{
|
||||
throw "BundleDir not found"
|
||||
|
Loading…
Reference in New Issue
Block a user