Skip to content

Commit d227248

Browse files
authored
Add Location to Add-AzureStackVMSSGalleryitem (#204)
1 parent c376bcf commit d227248

2 files changed

Lines changed: 27 additions & 18 deletions

File tree

ComputeAdmin/AzureStack.ComputeAdmin.psm1

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,36 @@
33

44
#requires -Modules AzureStack.Connect
55

6+
<#
7+
.SYNOPSIS
8+
Add-AzureStackVMSSGalleryItem: Adds the VMSS Gallery Item to your Azure Stack Marketplace.
9+
Remove-AzureStackVMSSGalleryItem: Adds the VMSS Gallery Item from your Azure Stack Marketplace.
10+
Add-VMImage: Uploads a VM Image to your Azure Stack and creates a Marketplace item for it.
11+
Remove-VMImage: Removes an existing VM Image from your Azure Stack. Does not delete any
12+
maketplace items created by Add-VMImage.
13+
New-Server2016VMImage: Creates and Uploads a new Server 2016 Core and / or Full Image and
14+
creates a Marketplace item for it.
15+
Get-VMImage: Gets a VM Image from your Azure Stack as an Administrator to view the provisioning state of the image.
16+
Add-VMExtension: Uploads a VM extension to your Azure Stack.
17+
Remove-VMExtension: Removes an existing VM extension from your Azure Stack.
18+
#>
19+
620
function Add-AzureStackVMSSGalleryItem {
21+
[CmdletBinding()]
22+
Param(
23+
[Parameter(Mandatory=$false)]
24+
[ValidatePattern("^[0-9a-zA-Z]+$")]
25+
[ValidateLength(1,128)]
26+
[String] $Location = 'local'
27+
)
728

829
$rgName = "vmss.gallery"
930

10-
New-AzureRmResourceGroup -Name $rgName -Location local -Force
31+
New-AzureRmResourceGroup -Name $rgName -Location $Location -Force
1132

1233
$saName = "vmssgallery"
1334

14-
$sa = New-AzureRmStorageAccount -ResourceGroupName $rgName -Location local -Name $saName -Type Standard_LRS
35+
$sa = New-AzureRmStorageAccount -ResourceGroupName $rgName -Location $Location -Name $saName -Type Standard_LRS
1536

1637
$cName = "gallery"
1738

@@ -41,19 +62,6 @@ function Remove-AzureStackVMSSGalleryItem {
4162
}
4263
}
4364

44-
<#
45-
.SYNOPSIS
46-
Contains 6 functions.
47-
Add-VMImage: Uploads a VM Image to your Azure Stack and creates a Marketplace item for it.
48-
Remove-VMImage: Removes an existing VM Image from your Azure Stack. Does not delete any
49-
maketplace items created by Add-VMImage.
50-
New-Server2016VMImage: Creates and Uploads a new Server 2016 Core and / or Full Image and
51-
creates a Marketplace item for it.
52-
Get-VMImage: Gets a VM Image from your Azure Stack as an Administrator to view the provisioning state of the image.
53-
Add-VMExtension: Uploads a VM extension to your Azure Stack.
54-
Remove-VMExtension: Removes an existing VM extension from your Azure Stack.
55-
#>
56-
5765
Function Add-VMImage{
5866

5967
[CmdletBinding(DefaultParameterSetName='VMImageFromLocal')]

ComputeAdmin/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,21 @@ VM Scale Set allows deployment of multi-VM collections. To add a gallery item wi
140140
3. Add VM Scale Set gallery item as follows
141141

142142
```powershell
143-
$Tenant = "<AAD Tenant Id used to connect to AzureStack>"
143+
$TenantId = "<AAD Tenant Id used to connect to AzureStack>"
144144
$Arm = "<AzureStack administrative Azure Resource Manager endpoint URL>"
145+
$Location = "<The location name of your AzureStack Environment>"
145146
146147
Add-AzureStackAzureRmEnvironment -Name AzureStackAdmin -ArmEndpoint $Arm
147148
148149
$Password = ConvertTo-SecureString -AsPlainText -Force "<your AzureStack admin user password>"
149150
$User = "<your AzureStack admin user name>"
150151
$Creds = New-Object System.Management.Automation.PSCredential $User, $Password
151152
152-
Login-AzureRmAccount -EnvironmentName AzureStackAdmin -Credential $Creds -TenantId $Tenant
153+
Login-AzureRmAccount -EnvironmentName AzureStackAdmin -Credential $Creds -TenantId $TenantId
153154
154155
Select-AzureRmSubscription -SubscriptionName "Default Provider Subscription"
155156
156-
Add-AzureStackVMSSGalleryItem
157+
Add-AzureStackVMSSGalleryItem -Location $Location
157158
```
158159
To remove VM Scale Set gallery item run the following command:
159160

0 commit comments

Comments
 (0)