diff --git a/ComputeAdmin/AzureStack.ComputeAdmin.psm1 b/ComputeAdmin/AzureStack.ComputeAdmin.psm1 index fb084f24..7a691c35 100644 --- a/ComputeAdmin/AzureStack.ComputeAdmin.psm1 +++ b/ComputeAdmin/AzureStack.ComputeAdmin.psm1 @@ -88,7 +88,7 @@ function Add-AzsVMImage { [Parameter(Mandatory = $true, ParameterSetName = 'VMImageFromLocal')] [Parameter(Mandatory = $true, ParameterSetName = 'VMImageFromAzure')] - [ValidatePattern("[a-zA-Z0-9-]{3,}")] + [ValidatePattern("[a-zA-Z0-9-\.]{3,}")] [String] $Sku, [Parameter(Mandatory = $true, ParameterSetName = 'VMImageFromLocal')] @@ -189,7 +189,7 @@ function Add-AzsVMImage { if ($PSBoundParameters.ContainsKey('dataDisksLocalPaths')) { foreach ($dataDiskLocalPath in $dataDisksLocalPaths) { $dataDiskName = Split-Path $dataDiskLocalPath -Leaf - $dataDiskBlobURI = "https://$storageAccountName.blob.$Domain/$containerName/$dataDiskName" + $dataDiskBlobURI = '{0}{1}/{2}' -f $storageAccount.PrimaryEndpoints.Blob.AbsoluteUri, $containerName, $dataDiskName $dataDiskBlobURIsFromLocal.Add($dataDiskBlobURI) Add-AzureRmVhd -Destination $dataDiskBlobURI -ResourceGroupName $resourceGroupName -LocalFilePath $dataDiskLocalPath -OverWrite } @@ -334,7 +334,7 @@ function Remove-AzsVMImage { [String] $Offer, [Parameter(Mandatory = $true)] - [ValidatePattern("[a-zA-Z0-9-]{3,}")] + [ValidatePattern("[a-zA-Z0-9-\.]{3,}")] [String] $Sku, [Parameter(Mandatory = $true)] @@ -353,7 +353,7 @@ function Remove-AzsVMImage { $VMImageExists = $false if (Get-AzsVMImage -publisher $publisher -offer $offer -sku $sku -version $version -location $location -ErrorAction SilentlyContinue) { - Write-Verbose "VM Image is present in Azure Stack - continuing to remove" -Verbose + Write-Verbose "VM Image is present in Azure Stack - continuing to remove" $VMImageExists = $true } else { @@ -370,7 +370,7 @@ function Remove-AzsVMImage { ApiVersion = "2015-12-01-preview" } - Write-Verbose -Message "Deleting VM Image" -Verbose + Write-Verbose -Message "Deleting VM Image" Remove-AzureRmResource @params -Force } catch { @@ -380,7 +380,7 @@ function Remove-AzsVMImage { } if (-not $KeepMarketplaceItem) { - Write-Verbose "Removing the marketplace item for the VM Image." -Verbose + Write-Verbose "Removing the marketplace item for the VM Image." $name = "$offer$sku" #Remove periods so that the offer and sku can be retrieved from the Marketplace Item name $name = $name -replace "\.", "-" @@ -409,7 +409,7 @@ function Get-AzsVMImage { [String] $Offer, [Parameter(Mandatory = $true)] - [ValidatePattern("[a-zA-Z0-9-]{3,}")] + [ValidatePattern("[a-zA-Z0-9-\.]{3,}")] [String] $Sku, [Parameter(Mandatory = $true)] @@ -474,9 +474,15 @@ function New-AzsServer2016VMImage { [Parameter()] [bool] $Net35 = $true, + [Parameter()] - [string] $MarketPlaceZipPath + [string] $MarketPlaceZipPath, + + + + [Parameter()][alias('sku_version')] + [version]$osImageSkuVersion = (date -Format yyyy.MM.dd).ToString() ) begin { @@ -567,7 +573,7 @@ function New-AzsServer2016VMImage { process { $location = Get-AzsHomeLocation -Location $location - Write-Verbose -Message "Checking ISO path for a valid ISO." -Verbose + Write-Verbose -Message "Checking ISO path for a valid ISO." if (!$IsoPath.ToLower().contains('.iso')) { Write-Error -Message "ISO path is not a valid ISO file." -ErrorAction Stop } @@ -596,7 +602,7 @@ function New-AzsServer2016VMImage { else { if ($IncludeLatestCU) { #for latest CU, check https://support.microsoft.com/en-us/help/4000825/windows-10-and-windows-server-2016-update-history - $Uri = 'http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/10/windows10.0-kb4041691-x64_6b578432462f6bec9b4c903b3119d437ef32eb29.msu' + $Uri = 'http://download.windowsupdate.com/d/msdownload/update/software/updt/2018/05/windows10.0-kb4103720-x64_c1fb7676d38fffae5c28b9216220c1f033ce26ac.msu' $OutFile = "$ModulePath\update.msu" } else { @@ -612,7 +618,7 @@ function New-AzsServer2016VMImage { } $CurrentProgressPref = $ProgressPreference $ProgressPreference = 'SilentlyContinue' - Write-Verbose -Message "Starting download of CU. This will take some time." -Verbose + Write-Verbose -Message "Starting download of CU. This will take some time." Invoke-WebRequest -Uri $Uri -OutFile $OutFile -UseBasicParsing $ProgressPreference = $CurrentProgressPref Unblock-File -Path $OutFile @@ -636,7 +642,7 @@ function New-AzsServer2016VMImage { $PublishArguments = @{ publisher = 'MicrosoftWindowsServer' offer = 'WindowsServer' - version = '1.0.0' + version = $osImageSkuVersion.ToString() osType = 'Windows' location = $location } @@ -656,7 +662,7 @@ function New-AzsServer2016VMImage { try { if ((!(Test-Path -Path $ImagePath)) -and (!$VMImageAlreadyAvailable)) { Write-Verbose -Message "Creating Server Core Image" - CreateWindowsVHD @ConvertParams -VHDPath $ImagePath -Edition $CoreEdition -ErrorAction Stop -Verbose + CreateWindowsVHD @ConvertParams -VHDPath $ImagePath -Edition $CoreEdition -ErrorAction Stop } else { Write-Verbose -Message "Server Core VHD already found." @@ -690,8 +696,8 @@ function New-AzsServer2016VMImage { } if ((!(Test-Path -Path $ImagePath)) -and (!$VMImageAlreadyAvailable)) { - Write-Verbose -Message "Creating Server Full Image" -Verbose - CreateWindowsVHD @ConvertParams -VHDPath $ImagePath -Edition $FullEdition -ErrorAction Stop -Verbose + Write-Verbose -Message "Creating Server Full Image" + CreateWindowsVHD @ConvertParams -VHDPath $ImagePath -Edition $FullEdition -ErrorAction Stop } else { Write-Verbose -Message "Server Full VHD already found." @@ -725,7 +731,7 @@ Function CreateGalleryItem { [ValidatePattern("[a-zA-Z0-9-]{3,}")] [String] $Offer, - [ValidatePattern("[a-zA-Z0-9-]{3,}")] + [ValidatePattern("[a-zA-Z0-9-\.]{3,}")] [String] $Sku, [ValidatePattern("\d+\.\d+\.\d")] @@ -749,6 +755,7 @@ Function CreateGalleryItem { New-Item -ItemType directory -Path $extractedGalleryItemPath | Out-Null expand-archive -Path "$workdir\CustomizedVMGalleryItem.zip" -DestinationPath $extractedGalleryItemPath -Force + # Check if we were provided with the MarketPlace Item Generator File if ( $MarketPlaceZipPath -eq '' ) { @@ -765,6 +772,7 @@ Function CreateGalleryItem { Write-Error "Failed to download Azure Stack Marketplace Item Generator" -ErrorAction Stop } } + } } else diff --git a/Connect/AzureStack.Connect.psm1 b/Connect/AzureStack.Connect.psm1 index b1774734..9acdce0e 100644 --- a/Connect/AzureStack.Connect.psm1 +++ b/Connect/AzureStack.Connect.psm1 @@ -2,7 +2,7 @@ # See LICENSE.txt in the project root for license information. #requires -Version 4.0 -#requires -Modules AzureRM.Profile, VpnClient, AzureRM.AzureStackAdmin +#requires -Modules AzureRM.Profile, VpnClient <# .SYNOPSIS diff --git a/Deployment/asdk-installer.ps1 b/Deployment/asdk-installer.ps1 index 6c37b5d5..50e5be38 100644 --- a/Deployment/asdk-installer.ps1 +++ b/Deployment/asdk-installer.ps1 @@ -97,8 +97,34 @@ $Xaml = @' xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - Title="Microsoft Azure Stack Development Kit" Height="650" Width="664" Background="#2D2D2F" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> + Title="Microsoft Azure Stack Development Kit" Height="650" Width="664" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> + + + + + + + + + - - - - @@ -231,6 +351,25 @@ $Xaml = @' + + + + + + + + + + + + + + + + + + + @@ -242,130 +381,259 @@ $Xaml = @' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - @@ -400,7 +668,6 @@ $Xaml = @' - @@ -533,6 +937,19 @@ $Xaml = @' + + + @@ -545,42 +962,42 @@ $Xaml = @' - - - + + + - - + + - - - + - + - +