Skip to content

Commit 0a40376

Browse files
authored
Merge pull request Azure#52 from bganapa/azurestack-uber
Azurestack uber module - Initial version - compatible for packing with the existing module
2 parents fc1a9bc + 06dbaf4 commit 0a40376

File tree

6 files changed

+288
-0
lines changed

6 files changed

+288
-0
lines changed

src/AzureStack/AzureStack.csproj

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<Version>0.0.1</Version>
4+
<LangVersion>7.1</LangVersion>
5+
<TargetFramework>netstandard2.0</TargetFramework>
6+
<OutputType>Library</OutputType>
7+
<AssemblyName>AzureStack.private</AssemblyName>
8+
<RootNamespace>Microsoft.Azure.PowerShell.Cmdlets.AzureStack</RootNamespace>
9+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
10+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
11+
<OutputPath>./bin</OutputPath>
12+
<PublishDir>$(OutputPath)</PublishDir>
13+
<NuspecFile>AzureStack.nuspec</NuspecFile>
14+
<NoPackageAnalysis>true</NoPackageAnalysis>
15+
<!-- Some methods are marked async and don't have an await in them -->
16+
<NoWarn>1998</NoWarn>
17+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
18+
<WarningsAsErrors />
19+
</PropertyGroup>
20+
21+
</Project>

src/AzureStack/AzureStack.nuspec

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
3+
<metadata>
4+
<id>AzureStack</id>
5+
<version>1.9.0</version>
6+
<authors>Microsoft Corporation</authors>
7+
<owners>Microsoft Corporation</owners>
8+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
9+
<licenseUrl>https://aka.ms/azps-license</licenseUrl>
10+
<projectUrl>https://github.com/Azure/azure-powershell</projectUrl>
11+
<description>Microsoft Azure PowerShell: $(service-name) cmdlets</description>
12+
<releaseNotes></releaseNotes>
13+
<copyright>Microsoft Corporation. All rights reserved.</copyright>
14+
<tags>Azure ResourceManager ARM PSModule $(service-name)</tags>
15+
</metadata>
16+
<files>
17+
<file src="AzureStack.psd1" />
18+
<!-- <file src="AzureStack.psm1" /> -->
19+
</files>
20+
</package>

src/AzureStack/AzureStack.psd1

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#
2+
# Module manifest for module 'AzureStack'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 3/22/2018
7+
#
8+
9+
@{
10+
11+
# Root Module
12+
# RootModule = ''
13+
14+
# Version number of this module.
15+
ModuleVersion = '1.9.0'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = '65f1e943-5e22-4b21-8350-82c798c958d2'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft Corporation. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Azure Stack Adminisitration Module'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '5.0'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
DotNetFrameworkVersion = '4.0'
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
CLRVersion = '4.0'
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.0'; },
55+
@{ModuleName = 'Az.Resources'; RequiredVersion = '0.9.0'; },
56+
@{ModuleName = 'Azs.AzureBridge.Admin'; RequiredVersion = '0.9.0'; },
57+
@{ModuleName = 'Azs.Backup.Admin'; RequiredVersion = '0.9.0'; },
58+
@{ModuleName = 'Azs.Commerce.Admin'; RequiredVersion = '0.9.0'; },
59+
@{ModuleName = 'Azs.Compute.Admin'; RequiredVersion = '0.9.0'; },
60+
@{ModuleName = 'Azs.Fabric.Admin'; RequiredVersion = '0.9.0'; },
61+
@{ModuleName = 'Azs.Gallery.Admin'; RequiredVersion = '0.9.0'; },
62+
@{ModuleName = 'Azs.InfrastructureInsights.Admin'; RequiredVersion = '0.9.0'; },
63+
@{ModuleName = 'Azs.KeyVault.Admin'; RequiredVersion = '0.9.0'; },
64+
@{ModuleName = 'Azs.Network.Admin'; RequiredVersion = '0.9.0'; },
65+
@{ModuleName = 'Azs.Storage.Admin'; RequiredVersion = '0.9.0'; },
66+
@{ModuleName = 'Azs.Subscriptions'; RequiredVersion = '0.9.0'; },
67+
@{ModuleName = 'Azs.Subscriptions.Admin'; RequiredVersion = '0.9.0'; },
68+
@{ModuleName = 'Azs.Update.Admin'; RequiredVersion = '0.9.0'; })
69+
70+
# Assemblies that must be loaded prior to importing this module
71+
# RequiredAssemblies = @()
72+
73+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
74+
# ScriptsToProcess = @()
75+
76+
# Type files (.ps1xml) to be loaded when importing this module
77+
# TypesToProcess = @()
78+
79+
# Format files (.ps1xml) to be loaded when importing this module
80+
# FormatsToProcess = @()
81+
82+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
83+
# NestedModules = @()
84+
85+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
86+
FunctionsToExport = @()
87+
88+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
89+
CmdletsToExport = @()
90+
91+
# Variables to export from this module
92+
# VariablesToExport = @()
93+
94+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
95+
AliasesToExport = @()
96+
97+
# DSC resources to export from this module
98+
# DscResourcesToExport = @()
99+
100+
# List of all modules packaged with this module
101+
# ModuleList = @()
102+
103+
# List of all files packaged with this module
104+
# FileList = @()
105+
106+
# 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.
107+
PrivateData = @{
108+
109+
PSData = @{
110+
111+
# Tags applied to this module. These help with module discovery in online galleries.
112+
# Tags = @()
113+
114+
# A URL to the license for this module.
115+
LicenseUri = 'https://aka.ms/azps-license'
116+
117+
# A URL to the main website for this project.
118+
ProjectUri = 'https://github.com/Azure/azure-powershell'
119+
120+
# A URL to an icon representing this module.
121+
# IconUri = ''
122+
123+
# ReleaseNotes of this module
124+
ReleaseNotes = ' - Version 1.9.0'
125+
126+
# External dependent modules of this module
127+
# ExternalModuleDependencies = ''
128+
129+
} # End of PSData hashtable
130+
131+
} # End of PrivateData hashtable
132+
133+
# HelpInfo URI of this module
134+
# HelpInfoURI = ''
135+
136+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
137+
# DefaultCommandPrefix = ''
138+
139+
}

src/AzureStack/build-module.ps1

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
15+
$ErrorActionPreference = 'Stop'
16+
17+
if($PSEdition -ne 'Core') {
18+
Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
19+
}
20+
21+
if(-not $Isolated -and -not $Debugger) {
22+
Write-Host -ForegroundColor Green 'Creating isolated process...'
23+
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
24+
& "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
25+
26+
if($LastExitCode -ne 0) {
27+
# Build failed. Don't attempt to run the module.
28+
return
29+
}
30+
31+
if($Test) {
32+
. (Join-Path $PSScriptRoot 'test-module.ps1')
33+
if($LastExitCode -ne 0) {
34+
# Tests failed. Don't attempt to run the module.
35+
return
36+
}
37+
}
38+
39+
40+
if($Pack) {
41+
. (Join-Path $PSScriptRoot 'pack-module.ps1')
42+
if($LastExitCode -ne 0) {
43+
# Packing failed. Don't attempt to run the module.
44+
return
45+
}
46+
}
47+
48+
$runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
49+
if($Code) {
50+
. $runModulePath -Code
51+
} elseif($Run) {
52+
. $runModulePath
53+
} else {
54+
Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
55+
}
56+
return
57+
}
58+
59+
$binFolder = Join-Path $PSScriptRoot 'bin'
60+
$objFolder = Join-Path $PSScriptRoot 'obj'
61+
62+
if(-not $Debugger) {
63+
Write-Host -ForegroundColor Green 'Cleaning build folders...'
64+
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
65+
66+
if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
67+
Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
68+
Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
69+
}
70+
71+
Write-Host -ForegroundColor Green 'Compiling module...'
72+
$buildConfig = 'Debug'
73+
if($Release) {
74+
$buildConfig = 'Release'
75+
}
76+
dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
77+
if($LastExitCode -ne 0) {
78+
Write-Error 'Compilation failed.'
79+
}
80+
81+
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
82+
}
83+
84+
$dll = Join-Path $PSScriptRoot 'bin\AzureStack.private.dll'
85+
if(-not (Test-Path $dll)) {
86+
Write-Error "Unable to find output assembly in '$binFolder'."
87+
}
88+
89+
90+
91+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/AzureStack/pack-module.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
Write-Host -ForegroundColor Green 'Packing module...'
15+
dotnet pack $PSScriptRoot --no-build /nologo
16+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/AzureStack/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)