Skip to content

Commit fa726bc

Browse files
authored
Add a check if the user is running Import from the product item folder instead of parent folder (#520)
1 parent a5a73e6 commit fa726bc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Syndication/AzureStack.MarketplaceSyndication.psm1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,21 @@ function PreCheck
667667
)
668668

669669
$dirs = Get-ChildItem -Path $contentFolder
670-
670+
$iconsFolder = Join-Path -Path $contentFolder -ChildPath "Icons"
671+
672+
# Check if the user specified marketplace item folder instead of parent directory
673+
if(Test-Path -Path $iconsFolder -PathType Container)
674+
{
675+
$message = @"
676+
`r`nImport-AzSOfflineMarketplaceItem requires specified content folder (specified with -origin parameter) to have 1 or more downloaded product folders.
677+
Each product folder should contain a product definition json file.
678+
E.g. product folder c:\downloads\product1 should contain c:\downloads\product1\product1.json
679+
Please specifiy correct top level folder that contains the list of downloaded products.
680+
"@
681+
Write-Verbose -Message "$message" -Verbose
682+
throw "$message"
683+
}
684+
671685
foreach ($dir in $dirs)
672686
{
673687
$folderPath = $contentFolder + "\$dir"

0 commit comments

Comments
 (0)