Skip to content

Commit

Permalink
Merge pull request Azure#52 from bganapa/azurestack-uber
Browse files Browse the repository at this point in the history
Azurestack uber module - Initial version - compatible for packing with the existing module
  • Loading branch information
bganapa authored Feb 18, 2020
2 parents fc1a9bc + 06dbaf4 commit 0a40376
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/AzureStack/AzureStack.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>0.0.1</Version>
<LangVersion>7.1</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Library</OutputType>
<AssemblyName>AzureStack.private</AssemblyName>
<RootNamespace>Microsoft.Azure.PowerShell.Cmdlets.AzureStack</RootNamespace>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>./bin</OutputPath>
<PublishDir>$(OutputPath)</PublishDir>
<NuspecFile>AzureStack.nuspec</NuspecFile>
<NoPackageAnalysis>true</NoPackageAnalysis>
<!-- Some methods are marked async and don't have an await in them -->
<NoWarn>1998</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>

</Project>
20 changes: 20 additions & 0 deletions src/AzureStack/AzureStack.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>AzureStack</id>
<version>1.9.0</version>
<authors>Microsoft Corporation</authors>
<owners>Microsoft Corporation</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<licenseUrl>https://aka.ms/azps-license</licenseUrl>
<projectUrl>https://github.com/Azure/azure-powershell</projectUrl>
<description>Microsoft Azure PowerShell: $(service-name) cmdlets</description>
<releaseNotes></releaseNotes>
<copyright>Microsoft Corporation. All rights reserved.</copyright>
<tags>Azure ResourceManager ARM PSModule $(service-name)</tags>
</metadata>
<files>
<file src="AzureStack.psd1" />
<!-- <file src="AzureStack.psm1" /> -->
</files>
</package>
139 changes: 139 additions & 0 deletions src/AzureStack/AzureStack.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#
# Module manifest for module 'AzureStack'
#
# Generated by: Microsoft Corporation
#
# Generated on: 3/22/2018
#

@{

# Root Module
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.9.0'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '65f1e943-5e22-4b21-8350-82c798c958d2'

# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Azure Stack Adminisitration Module'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.0'

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
DotNetFrameworkVersion = '4.0'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
CLRVersion = '4.0'

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.0'; },
@{ModuleName = 'Az.Resources'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.AzureBridge.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Backup.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Commerce.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Compute.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Fabric.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Gallery.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.InfrastructureInsights.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.KeyVault.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Network.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Storage.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Subscriptions'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Subscriptions.Admin'; RequiredVersion = '0.9.0'; },
@{ModuleName = 'Azs.Update.Admin'; RequiredVersion = '0.9.0'; })

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# 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.
FunctionsToExport = @()

# 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.
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# 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.
AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# 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.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = ' - Version 1.9.0'

# External dependent modules of this module
# ExternalModuleDependencies = ''

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
91 changes: 91 additions & 0 deletions src/AzureStack/build-module.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
}

if(-not $Isolated -and -not $Debugger) {
Write-Host -ForegroundColor Green 'Creating isolated process...'
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
& "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated

if($LastExitCode -ne 0) {
# Build failed. Don't attempt to run the module.
return
}

if($Test) {
. (Join-Path $PSScriptRoot 'test-module.ps1')
if($LastExitCode -ne 0) {
# Tests failed. Don't attempt to run the module.
return
}
}


if($Pack) {
. (Join-Path $PSScriptRoot 'pack-module.ps1')
if($LastExitCode -ne 0) {
# Packing failed. Don't attempt to run the module.
return
}
}

$runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
if($Code) {
. $runModulePath -Code
} elseif($Run) {
. $runModulePath
} else {
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."
}
return
}

$binFolder = Join-Path $PSScriptRoot 'bin'
$objFolder = Join-Path $PSScriptRoot 'obj'

if(-not $Debugger) {
Write-Host -ForegroundColor Green 'Cleaning build folders...'
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder

if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
}

Write-Host -ForegroundColor Green 'Compiling module...'
$buildConfig = 'Debug'
if($Release) {
$buildConfig = 'Release'
}
dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
if($LastExitCode -ne 0) {
Write-Error 'Compilation failed.'
}

$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
}

$dll = Join-Path $PSScriptRoot 'bin\AzureStack.private.dll'
if(-not (Test-Path $dll)) {
Write-Error "Unable to find output assembly in '$binFolder'."
}



Write-Host -ForegroundColor Green '-------------Done-------------'
16 changes: 16 additions & 0 deletions src/AzureStack/pack-module.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------
Write-Host -ForegroundColor Green 'Packing module...'
dotnet pack $PSScriptRoot --no-build /nologo
Write-Host -ForegroundColor Green '-------------Done-------------'
1 change: 1 addition & 0 deletions src/AzureStack/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 0a40376

Please sign in to comment.