137a138,140 > [Parameter(ParameterSetName = 'VMImageFromLocal')] > [string] $MarketPlaceZipPath = '', > 278a282 > Write-Verbose -Message "Checking VM Image" -Verbose 300c304 < $GalleryItem = CreateGalleryItem -publisher $publisher -offer $offer -sku $sku -version $version -osType $osType -title $title -description $description --- > $GalleryItem = CreateGalleryItem -publisher $publisher -offer $offer -sku $sku -version $version -osType $osType -title $title -description $description -MarketPlaceZipPath "$MarketPlaceZipPath" 473c477,480 < [bool] $Net35 = $true --- > [bool] $Net35 = $true, > > [Parameter()] > [string] $MarketPlaceZipPath 660c667 < Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Core Eval" -description $description -CreateGalleryItem $CreateGalleryItem --- > Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Core Eval" -description $description -CreateGalleryItem $CreateGalleryItem -MarketPlaceZipPath "$MarketPlaceZipPath" 663c670 < Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -CreateGalleryItem $CreateGalleryItem --- > Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -CreateGalleryItem $CreateGalleryItem -MarketPlaceZipPath "$MarketPlaceZipPath" 694c701 < Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Eval" -description $description -CreateGalleryItem $CreateGalleryItem --- > Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Eval" -description $description -CreateGalleryItem $CreateGalleryItem -MarketPlaceZipPath "$MarketPlaceZipPath" 697c704 < Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -CreateGalleryItem $CreateGalleryItem --- > Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -CreateGalleryItem $CreateGalleryItem -MarketPlaceZipPath "$MarketPlaceZipPath" 732c739,741 < [string] $Description --- > [string] $Description, > > [string] $MarketPlaceZipPath = '' 733a743,744 > write-verbose -Message "Entering CreateGallaryItem Function" -Verbose > 742,752c753,767 < < $maxAttempts = 5 < for ($retryAttempts = 1; $retryAttempts -le $maxAttempts; $retryAttempts++) { < try { < Write-Verbose -Message "Downloading Azure Stack Marketplace Item Generator Attempt $retryAttempts" -Verbose < Invoke-WebRequest -Uri http://www.aka.ms/azurestackmarketplaceitem -OutFile "$workdir\MarketplaceItem.zip" < break < } < catch { < if ($retryAttempts -ge $maxAttempts) { < Write-Error "Failed to download Azure Stack Marketplace Item Generator" -ErrorAction Stop --- > > # Check if we were provided with the MarketPlace Item Generator File > if ( $MarketPlaceZipPath -eq '' ) > { > $maxAttempts = 5 > for ($retryAttempts = 1; $retryAttempts -le $maxAttempts; $retryAttempts++) { > try { > Write-Verbose -Message "Downloading Azure Stack Marketplace Item Generator Attempt $retryAttempts" -Verbose > Invoke-WebRequest -Uri http://www.aka.ms/azurestackmarketplaceitem -OutFile "$workdir\MarketplaceItem.zip" > break > } > catch { > if ($retryAttempts -ge $maxAttempts) { > Write-Error "Failed to download Azure Stack Marketplace Item Generator" -ErrorAction Stop > } 755a771,791 > else > { > write-verbose -Message "Copying Marketplace Item Generator to working directory" -Verbose > > # Copy the provided file into the working directory > if ( Test-Path -Path "$MarketPlaceZipPath" ) > { > try { > Write-Verbose -Message "Copying Market Place Item Generator zip file into working directory" -Verbose > copy-item -Path "$MarketPlaceZipPath" -Destination "$workdir\MarketplaceItem.zip" > } > catch > { > Write-Error "Failed to copy Market Place Item Generator zip into working directory: $_" -ErrorAction Stop > } > } > else > { > Write-Error "Provided Market Place Item Generator zip file does not exist" -ErrorAction Stop > } > }