Skip to content

Commit c83560e

Browse files
authored
Merge pull request #3213 from markcowl/azstackadmin
Add AzureStackAdmin module
2 parents 5766694 + 0ade09f commit c83560e

File tree

6 files changed

+185
-22
lines changed

6 files changed

+185
-22
lines changed

build.proj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@
194194
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
195195
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
196196
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
197-
197+
<Copy SourceFiles="$(LibraryRoot)tools\AzureStack\AzureStack.psd1"
198+
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
199+
<Copy SourceFiles="$(LibraryRoot)tools\AzureStack\AzureStack.psm1"
200+
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition="Exists('$(LibraryRoot)tools\AzureStack\AzureStack.psm1')"/>
201+
198202
<ItemGroup>
199203
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
200204
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" />
@@ -249,7 +253,10 @@
249253
DestinationFolder="$(LibraryRoot)tools\AzureRM" />
250254
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psm1"
251255
DestinationFolder="$(LibraryRoot)tools\AzureRM" />
252-
</Target>
256+
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureStack.psd1"
257+
DestinationFolder="$(LibraryRoot)tools\AzureStack" Condition="Exists('$(LibraryRoot)tools\AzureStack\AzureStack.psm1')" />
258+
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureStack.psm1"
259+
DestinationFolder="$(LibraryRoot)tools\AzureStack" Condition="Exists('$(LibraryRoot)tools\AzureStack\AzureStack.psm1')" /> </Target>
253260

254261
<Target Name="CodeSignInstaller">
255262
<PropertyGroup>

tools/AzureRM/AzureRM.psd1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ RequiredModules = @(@{ModuleName="AzureRM.Profile"; RequiredVersion="1.0.4.1"},
5353
@{ModuleName="AzureRM.ApiManagement"; RequiredVersion="1.0.4.1"},
5454
@{ModuleName="AzureRM.Automation"; RequiredVersion="1.0.4.1"},
5555
@{ModuleName="AzureRM.Automation"; RequiredVersion="1.0.4.1"},
56-
@{ModuleName="AzureRM.AzureStackAdmin"; RequiredVersion="0.9.11"},
57-
@{ModuleName="AzureRM.AzureStackStorage"; RequiredVersion="0.10.1"},
5856
@{ModuleName="AzureRM.Batch"; RequiredVersion="1.0.4.1"},
5957
@{ModuleName="AzureRM.Compute"; RequiredVersion="1.2.2.1"},
6058
@{ModuleName="AzureRM.DataFactories"; RequiredVersion="1.0.4.1"},

tools/AzureStack/AzureStack.psd1

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#
2+
# Module manifest for module 'PSGet_AzureStack'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 11/14/2016
7+
#
8+
9+
@{
10+
11+
# Version number of this module.
12+
ModuleVersion = '1.2.7'
13+
14+
# ID used to uniquely identify this module
15+
GUID = '65f1e943-5e22-4b21-8350-82c798c958d2'
16+
17+
# Author of this module
18+
Author = 'Microsoft Corporation'
19+
20+
# Company or vendor of this module
21+
CompanyName = 'Microsoft Corporation'
22+
23+
# Copyright statement for this module
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
25+
26+
# Description of the functionality provided by this module
27+
Description = 'Azure Stack Adminisitration Module'
28+
29+
# Minimum version of the Windows PowerShell engine required by this module
30+
PowerShellVersion = '3.0'
31+
32+
# Name of the Windows PowerShell host required by this module
33+
# PowerShellHostName = ''
34+
35+
# Minimum version of the Windows PowerShell host required by this module
36+
# PowerShellHostVersion = ''
37+
38+
# Minimum version of Microsoft .NET Framework required by this module
39+
DotNetFrameworkVersion = '4.0'
40+
41+
# Minimum version of the common language runtime (CLR) required by this module
42+
CLRVersion = '4.0'
43+
44+
# Processor architecture (None, X86, Amd64) required by this module
45+
# ProcessorArchitecture = 'None'
46+
47+
# Modules that must be imported into the global environment prior to importing this module
48+
RequiredModules = @(@{ModuleName="AzureRM.Profile"; RequiredVersion="1.0.4.1"},
49+
@{ModuleName="AzureRM.AzureStackAdmin"; RequiredVersion="0.10.2"},
50+
@{ModuleName="AzureRM.AzureStackStorage"; RequiredVersion="0.10.1"})
51+
52+
# Assemblies that must be loaded prior to importing this module
53+
# RequiredAssemblies = @()
54+
55+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
56+
# ScriptsToProcess = @()
57+
58+
# Type files (.ps1xml) to be loaded when importing this module
59+
# TypesToProcess = @()
60+
61+
# Format files (.ps1xml) to be loaded when importing this module
62+
# FormatsToProcess = @()
63+
64+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
65+
# NestedModules = @()
66+
67+
# Functions to export from this module
68+
# FunctionsToExport = @()
69+
70+
# Cmdlets to export from this module
71+
# CmdletsToExport = @()
72+
73+
# Variables to export from this module
74+
# VariablesToExport = @()
75+
76+
# Aliases to export from this module
77+
# AliasesToExport = @()
78+
79+
# DSC resources to export from this module
80+
# DscResourcesToExport = @()
81+
82+
# List of all modules packaged with this module
83+
# ModuleList = @()
84+
85+
# List of all files packaged with this module
86+
# FileList = @()
87+
88+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
89+
PrivateData = @{
90+
91+
PSData = @{
92+
93+
# Tags applied to this module. These help with module discovery in online galleries.
94+
# Tags = @()
95+
96+
# A URL to the license for this module.
97+
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/stack-dev/LICENSE.txt'
98+
99+
# A URL to the main website for this project.
100+
ProjectUri = 'https://github.com/Azure/azure-powershell'
101+
102+
# A URL to an icon representing this module.
103+
# IconUri = ''
104+
105+
# ReleaseNotes of this module
106+
ReleaseNotes = '2016.11.11 - Version 1.2.7
107+
* AzureStackAdmin
108+
* The Add-AzureRmResourceProviderRegistration changes for accepting the return code of 202 Accepted for the PUT manifest call
109+
- Fix the issue of ProvisioningState and ExtensionName not getting populated with correct values
110+
- Fix the issue of missing dependency dll Microsoft.Azure.Common.NetFramework.dll'
111+
112+
# External dependent modules of this module
113+
# ExternalModuleDependencies = ''
114+
115+
} # End of PSData hashtable
116+
117+
} # End of PrivateData hashtable
118+
119+
# HelpInfo URI of this module
120+
# HelpInfoURI = ''
121+
122+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
123+
# DefaultCommandPrefix = ''
124+
125+
}
126+

tools/AzureStack/AzureStack.psm1

1.74 KB
Binary file not shown.

tools/PublishModules.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function Get-TargetModules
6161
$targets += $module.FullName
6262
}
6363
}
64-
} elseif (($Scope -ne 'AzureRM') -and ($Scope -ne "ServiceManagement") -and ($Scope -ne "AzureStorage")) {
64+
} elseif (($Scope -ne 'AzureRM') -and ($Scope -ne "ServiceManagement") -and ($Scope -ne "AzureStorage") -and ($Scope -ne "AzureStack")) {
6565
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"
6666
if (Test-Path $modulePath) {
6767
$targets += $modulePath
@@ -75,6 +75,11 @@ function Get-TargetModules
7575
$targets += "$PSScriptRoot\AzureRM"
7676
}
7777

78+
if (($Scope -eq 'All') -or ($Scope -eq 'AzureStack')) {
79+
# Publish AzureStack module
80+
$targets += "$PSScriptRoot\AzureStack"
81+
}
82+
7883
Write-Output -InputObject $targets
7984
}
8085
}
@@ -174,10 +179,10 @@ function Change-RMModule
174179
Write-Output "Expanding $zipPath"
175180
Expand-Archive $zipPath
176181
Write-Output "Adding PSM1 dependency to $unzippedManifest"
177-
Add-PSM1Dependency -Path $unzippedManifest
182+
Add-PSM1Dependency -Path $unzippedManifest
178183
Write-Output "Removing module manifest dependencies for $unzippedManifest"
179-
Remove-ModuleDependencies -Path $unzippedManifest
180-
184+
Remove-ModuleDependencies -Path $unzippedManifest
185+
181186
Remove-Item -Path $zipPath -Force
182187
Write-Output "Compressing $zipPath"
183188
Compress-Archive (Join-Path -Path $dirPath -ChildPath "*") -DestinationPath $zipPath

tools/UpdateModules.ps1

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
14+
15+
param(
16+
[Parameter(Mandatory = $false, Position = 0)]
17+
[string] $buildConfig,
18+
[Parameter(Mandatory = $false, Position = 1)]
19+
[string] $scope
20+
)
21+
1422
function Create-ModulePsm1
1523
{
1624
[CmdletBinding()]
@@ -24,7 +32,7 @@ function Create-ModulePsm1
2432
$manifestDir = Get-Item -Path $ModulePath
2533
$moduleName = $manifestDir.Name + ".psd1"
2634
$manifestPath = Join-Path -Path $ModulePath -ChildPath $moduleName
27-
$module = Test-ModuleManifest -Path $manifestPath
35+
$module = Test-ModuleManifest -Path $manifestPath -ErrorAction "SilentlyContinue"
2836
$templateOutputPath = $manifestPath -replace ".psd1", ".psm1"
2937
[string]$strict
3038
[string]$loose
@@ -44,13 +52,6 @@ function Create-ModulePsm1
4452
}
4553
}
4654

47-
param(
48-
[Parameter(Mandatory = $false, Position = 0)]
49-
[string] $buildConfig,
50-
[Parameter(Mandatory = $false, Position = 1)]
51-
[string] $scope
52-
)
53-
5455
if ([string]::IsNullOrEmpty($buildConfig))
5556
{
5657
Write-Verbose "Setting build configuration to 'Release'"
@@ -67,10 +68,8 @@ Write-Host "Updating $scope package(and its dependencies)"
6768

6869
$packageFolder = "$PSScriptRoot\..\src\Package"
6970

70-
71-
7271
$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
73-
$publishToLocal = test-path $repositoryLocation
72+
$publishToLocal = $true
7473
$templateLocation = "$PSScriptRoot\AzureRM.Example.psm1"
7574
if (($scope -eq 'All') -or $publishToLocal ) {
7675
# If we publish 'All' or to local folder, publish AzureRM.Profile first, becasue it is the common dependency
@@ -94,18 +93,37 @@ if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) {
9493
}
9594

9695
$resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory
97-
if ($scope -eq 'All') {
96+
if ($scope -eq 'All' -or $scope -eq 'AzureRM') {
9897
foreach ($module in $resourceManagerModules) {
9998
# filter out AzureRM.Profile which always gets published first
10099
# And "Azure.Storage" which is built out as test dependencies
101-
if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage")) {
100+
# And the AzureStack modules
101+
if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage") -and `
102+
($module.Name -ne "AzureRM.AzureStackAdmin") -and ($module.Name -ne "AzureRM.AzureStackStorage")) {
102103
$modulePath = $module.FullName
103104
Write-Host "Updating $module module from $modulePath"
104105
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
105106
Write-Host "Updated $module module"
106107
}
107108
}
108-
} elseif ($scope -ne 'AzureRM') {
109+
} elseif ($scope -eq 'AzureStack' -or $scope -eq 'All') {
110+
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.AzureStackAdmin"
111+
if (Test-Path $modulePath) {
112+
Write-Host "Updating AzureRM.AzureStackAdmin module from $modulePath"
113+
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
114+
Write-Host "Updated AzureRM.AzureStackAdmin module"
115+
} else {
116+
Write-Error "Can not find module with name $scope to publish"
117+
}
118+
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.AzureStackStorage"
119+
if (Test-Path $modulePath) {
120+
Write-Host "Updating AzureRM.AzureStackStorage module from $modulePath"
121+
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
122+
Write-Host "Updated AzureRM.AzureStackStorage module"
123+
} else {
124+
Write-Error "Can not find module with name $scope to publish"
125+
}
126+
} elseif ($scope -ne 'AzureRM' -and $scope -ne 'AzureStack') {
109127
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"
110128
if (Test-Path $modulePath) {
111129
Write-Host "Updating $scope module from $modulePath"
@@ -123,3 +141,12 @@ if (($scope -eq 'All') -or ($scope -eq 'AzureRM')) {
123141
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
124142
Write-Host "Updated Azure module"
125143
}
144+
145+
if ($scope -eq 'AzureStack') {
146+
# Update AzureStack module
147+
$modulePath = "$PSScriptRoot\AzureStack"
148+
Write-Host "Updating AzureStack module from $modulePath"
149+
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
150+
Write-Host "Updated AzureStack module"
151+
}
152+

0 commit comments

Comments
 (0)