Skip to content

Commit 98944b9

Browse files
author
Maddie Clayton
authored
Merge branch 'preview' into psm1
2 parents 23be13a + bb4d8e9 commit 98944b9

File tree

153 files changed

+2193
-2107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2193
-2107
lines changed

src/StackAdmin/Azs.Gallery.Admin/Module/Azs.Gallery.Admin/Azs.Gallery.Admin.psd1

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Licensed under the MIT License. See License.txt in the project root for license
1717
RootModule = 'Azs.Gallery.Admin.psm1'
1818

1919
# Version number of this module.
20-
ModuleVersion = '0.1.1'
20+
ModuleVersion = '0.2.0'
2121

2222
# Supported PSEditions
2323
# CompatiblePSEditions = @()
@@ -38,7 +38,7 @@ Licensed under the MIT License. See License.txt in the project root for license
3838
Description = 'Gallery Admin Client'
3939

4040
# Minimum version of the Windows PowerShell engine required by this module
41-
# PowerShellVersion = ''
41+
PowerShellVersion = '5.0'
4242

4343
# Name of the Windows PowerShell host required by this module
4444
# PowerShellHostName = ''
@@ -56,8 +56,8 @@ Licensed under the MIT License. See License.txt in the project root for license
5656
# ProcessorArchitecture = ''
5757

5858
# Modules that must be imported into the global environment prior to importing this module
59-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; RequiredVersion = '3.4.1'; },
60-
@{ModuleName = 'AzureRM.Resources'; RequiredVersion = '4.4.1'; })
59+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.5.1'; },
60+
@{ModuleName = 'AzureRM.Resources'; ModuleVersion = '6.0.2'; })
6161

6262
# Assemblies that must be loaded prior to importing this module
6363
# RequiredAssemblies = @()
@@ -102,19 +102,25 @@ Licensed under the MIT License. See License.txt in the project root for license
102102
PSData = @{
103103

104104
# Tags applied to this module. These help with module discovery in online galleries.
105-
# Tags = @()
105+
Tags = @('AzureStack', 'Azure Stack', 'Admin', 'Gallery', 'Azure Stack Gallery')
106106

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

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

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

116116
# ReleaseNotes of this module
117-
# ReleaseNotes = ''
117+
ReleaseNotes = '## 2018.8.12
118+
* Module dependencies updated
119+
* AzureRM.Profile
120+
* AzureRM.Resources
121+
* Bug fixes
122+
* Handle ErrrorAction correctly now
123+
'
118124

119125
} # End of PSData hashtable
120126

src/StackAdmin/Azs.Gallery.Admin/Module/Azs.Gallery.Admin/Azs.Gallery.Admin.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ if (Test-Path -Path $ClrPath -PathType Container) {
2929
. (Join-Path -Path $PSScriptRoot -ChildPath 'Get-ApplicableFilters.ps1')
3030
. (Join-Path -Path $PSScriptRoot -ChildPath 'Test-FilteredResult.ps1')
3131
. (Join-Path -Path $PSScriptRoot -ChildPath 'Get-ArmResourceIdParameterValue.ps1')
32+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Get-ResourceNameSuffix.ps1')
3233
$allPs1FilesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Generated.PowerShell.Commands' | Join-Path -ChildPath '*.ps1'
3334
Get-ChildItem -Path $allPs1FilesPath -Recurse -File | ForEach-Object { . $_.FullName}

src/StackAdmin/Azs.Gallery.Admin/Module/Azs.Gallery.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Add-AzsGalleryItem.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ function Add-AzsGalleryItem {
4949

5050
Process {
5151

52-
53-
5452
if ($PSCmdlet.ShouldProcess("$GalleryItemUri" , "Add Gallery item")) {
5553
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Gallery item could already exist, are you sure?", "Performing operation add gallery item from $GalleryItemUri")) {
5654

src/StackAdmin/Azs.Gallery.Admin/Module/Azs.Gallery.Admin/Get-ApplicableFilters.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Get-ApplicableFilters {
2121
$Filters
2222
)
2323

24-
$ErrorActionPreference = 'Stop'
24+
2525
foreach ($filter in $Filters) {
2626
$res = @{
2727
Filter = $filter
@@ -31,7 +31,7 @@ function Get-ApplicableFilters {
3131
if (Test-WildcardFilter -Filter $filter) {
3232
$res['Strict'] = $true
3333
}
34-
}
34+
}
3535
elseif ($filter.Type -eq 'equalityOperator') {
3636
if (Test-EqualityFilter -Filter $filter) {
3737
$res['Strict'] = $true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
function Get-ResourceNameSuffix {
3+
param(
4+
[string]$ResourceName
5+
)
6+
if ($null -ne $ResourceName -and $ResourceName.Contains('/')) {
7+
$ResourceName = $ResourceName.Split("/")[-1]
8+
}
9+
return $ResourceName
10+
}

src/StackAdmin/Azs.Gallery.Admin/Module/Azs.Gallery.Admin/Get-TaskResult.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ function Get-TaskResult {
5959
} catch {
6060
# Catch exception so no output.
6161
} finally {
62-
throw $Exception
62+
Write-Error -Exception $Exception
6363
}
6464
}
6565

66-
$ErrorActionPreference = 'Stop'
66+
6767
$null = $TaskResult.AsyncWaitHandle.WaitOne()
6868
Write-Debug -Message "$($TaskResult | Out-String)"
6969

src/StackAdmin/Azs.Gallery.Admin/Module/Azs.Gallery.Admin/Test-FilteredResult.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Test-FilteredResult {
2727
$Filter
2828
)
2929

30-
$ErrorActionPreference = 'Stop'
30+
3131
if ($Filter.Type -eq 'wildcard') {
3232
Test-WildcardFilterOnResult -Filter $Filter -Result $Result
3333
} elseif ($Filter.Type -eq 'equalityOperator') {

src/StackAdmin/Azs.Gallery.Admin/Tests/Azs.Gallery.Admin.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
</ProjectReference>
6565
</ItemGroup>
6666
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
67-
</Project>
67+
</Project>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.AzureStack.Management.Gallery.Admin" version="0.1.0-preview" targetFramework="net452" />
4-
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.6.0" targetFramework="net45" />
5-
</packages>
3+
<package id="Microsoft.AzureStack.Management.Gallery.Admin" version="0.1.0-preview" targetFramework="net45" />
4+
</packages>

src/StackAdmin/Azs.Gallery.Admin/Tests/src/Common.ps1

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15+
$global:SkippedTests = @()
16+
1517
$global:TestName = ""
1618

17-
if(-not $RunRaw) {
18-
# Load the script block
19-
$scriptBlock = {
20-
Get-MockClient -ClassName 'GalleryAdminClient' -TestName $global:TestName
21-
}
22-
Mock New-ServiceClient $scriptBlock -ModuleName $global:ModuleName
19+
$global:Client = $null
20+
21+
if (-not $global:RunRaw) {
22+
# Load the script block
23+
$scriptBlock = {
24+
if ($null -eq $global:Client) {
25+
$global:Client = Get-MockClient -ClassName 'GalleryAdminClient' -TestName $global:TestName
26+
}
27+
$global:Client
28+
}
29+
Mock New-ServiceClient $scriptBlock -ModuleName $global:ModuleName
2330
}
2431

2532
if (Test-Path "$PSScriptRoot\Override.ps1") {

src/StackAdmin/Azs.Gallery.Admin/Tests/src/GalleryItem.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ InModuleScope Azs.Gallery.Admin {
127127
}
128128
}
129129

130+
AfterEach {
131+
$global:Client = $null
132+
}
133+
130134

131135
it "TestListAllGalleryItems" -Skip:$('TestListAllGalleryItems' -in $global:SkippedTests) {
132136
$global:TestName = 'TestListAllGalleryItems'

src/StackAdmin/Azs.KeyVault.Admin/Module/Azs.KeyVault.Admin/Azs.Keyvault.Admin.psd1

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Licensed under the MIT License. See License.txt in the project root for license
1717
RootModule = 'Azs.KeyVault.Admin.psm1'
1818

1919
# Version number of this module.
20-
ModuleVersion = '0.1.1'
20+
ModuleVersion = '0.2.0'
2121

2222
# Supported PSEditions
2323
# CompatiblePSEditions = @()
@@ -29,7 +29,7 @@ Licensed under the MIT License. See License.txt in the project root for license
2929
Author = 'Microsoft'
3030

3131
# Company or vendor of this module
32-
CompanyName = 'Unknown'
32+
CompanyName = 'Microsoft'
3333

3434
# Copyright statement for this module
3535
Copyright = '(c) 2018 Microsoft. All rights reserved.'
@@ -38,7 +38,7 @@ Licensed under the MIT License. See License.txt in the project root for license
3838
Description = 'KeyVault Admin Client'
3939

4040
# Minimum version of the Windows PowerShell engine required by this module
41-
# PowerShellVersion = ''
41+
PowerShellVersion = '5.0'
4242

4343
# Name of the Windows PowerShell host required by this module
4444
# PowerShellHostName = ''
@@ -56,8 +56,8 @@ Licensed under the MIT License. See License.txt in the project root for license
5656
# ProcessorArchitecture = ''
5757

5858
# Modules that must be imported into the global environment prior to importing this module
59-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; RequiredVersion = '3.4.1'; },
60-
@{ModuleName = 'AzureRM.Resources'; RequiredVersion = '4.4.1'; })
59+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.5.1'; },
60+
@{ModuleName = 'AzureRM.Resources'; ModuleVersion = '6.0.2'; })
6161

6262
# Assemblies that must be loaded prior to importing this module
6363
# RequiredAssemblies = @()
@@ -101,19 +101,25 @@ Licensed under the MIT License. See License.txt in the project root for license
101101
PSData = @{
102102

103103
# Tags applied to this module. These help with module discovery in online galleries.
104-
# Tags = @()
104+
Tags = @('AzureStack', 'Azure Stack', 'Admin', 'KeyVault', 'Azure Stack KeyVault', 'KV')
105105

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

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

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

115115
# ReleaseNotes of this module
116-
# ReleaseNotes = ''
116+
ReleaseNotes = '## 2018.8.12
117+
* Module dependencies updated
118+
* AzureRM.Profile
119+
* AzureRM.Resources
120+
* Bug fixes
121+
* Handle ErrrorAction correctly now
122+
'
117123

118124
} # End of PSData hashtable
119125

src/StackAdmin/Azs.KeyVault.Admin/Module/Azs.KeyVault.Admin/Azs.Keyvault.Admin.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ if (Test-Path -Path $ClrPath -PathType Container) {
2929
. (Join-Path -Path $PSScriptRoot -ChildPath 'Get-ApplicableFilters.ps1')
3030
. (Join-Path -Path $PSScriptRoot -ChildPath 'Test-FilteredResult.ps1')
3131
. (Join-Path -Path $PSScriptRoot -ChildPath 'Get-ArmResourceIdParameterValue.ps1')
32+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Get-ResourceNameSuffix.ps1')
3233
$allPs1FilesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Generated.PowerShell.Commands' | Join-Path -ChildPath '*.ps1'
3334
Get-ChildItem -Path $allPs1FilesPath -Recurse -File | ForEach-Object { . $_.FullName}

src/StackAdmin/Azs.KeyVault.Admin/Module/Azs.KeyVault.Admin/Get-ApplicableFilters.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Get-ApplicableFilters {
2121
$Filters
2222
)
2323

24-
$ErrorActionPreference = 'Stop'
24+
2525
foreach ($filter in $Filters) {
2626
$res = @{
2727
Filter = $filter
@@ -31,7 +31,7 @@ function Get-ApplicableFilters {
3131
if (Test-WildcardFilter -Filter $filter) {
3232
$res['Strict'] = $true
3333
}
34-
}
34+
}
3535
elseif ($filter.Type -eq 'equalityOperator') {
3636
if (Test-EqualityFilter -Filter $filter) {
3737
$res['Strict'] = $true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
function Get-ResourceNameSuffix {
3+
param(
4+
[string]$ResourceName
5+
)
6+
if ($null -ne $ResourceName -and $ResourceName.Contains('/')) {
7+
$ResourceName = $ResourceName.Split("/")[-1]
8+
}
9+
return $ResourceName
10+
}

src/StackAdmin/Azs.KeyVault.Admin/Module/Azs.KeyVault.Admin/Get-TaskResult.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ function Get-TaskResult {
5959
} catch {
6060
# Catch exception so no output.
6161
} finally {
62-
throw $Exception
62+
Write-Error -Exception $Exception
6363
}
6464
}
6565

66-
$ErrorActionPreference = 'Stop'
66+
6767
$null = $TaskResult.AsyncWaitHandle.WaitOne()
6868
Write-Debug -Message "$($TaskResult | Out-String)"
6969

src/StackAdmin/Azs.KeyVault.Admin/Module/Azs.KeyVault.Admin/Test-FilteredResult.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Test-FilteredResult {
2727
$Filter
2828
)
2929

30-
$ErrorActionPreference = 'Stop'
30+
3131
if ($Filter.Type -eq 'wildcard') {
3232
Test-WildcardFilterOnResult -Filter $Filter -Result $Result
3333
} elseif ($Filter.Type -eq 'equalityOperator') {

src/StackAdmin/Azs.KeyVault.Admin/Tests/Azs.KeyVault.Admin.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@
6565
</ProjectReference>
6666
</ItemGroup>
6767
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
68-
</Project>
68+
</Project>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.AzureStack.Management.KeyVault.Admin" version="0.1.0-preview" targetFramework="net45" />
4-
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.6.0" targetFramework="net45" />
5-
</packages>
4+
</packages>

src/StackAdmin/Azs.KeyVault.Admin/Tests/src/Common.ps1

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
1-
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+
15+
$global:SkippedTests = @()
16+
217
$global:Location = 'local'
318

4-
if(-not $global:RunRaw) {
5-
$scriptBlock = {
6-
Get-MockClient -ClassName 'KeyVaultAdminClient' -TestName $global:TestName -Verbose
7-
}
8-
Mock New-ServiceClient $scriptBlock -ModuleName $global:ModuleName
19+
$global:Client = $null
20+
21+
if (-not $global:RunRaw) {
22+
$scriptBlock = {
23+
if ($null -eq $global:Client) {
24+
$global:Client = Get-MockClient -ClassName 'KeyVaultAdminClient' -TestName $global:TestName -Verbose
25+
}
26+
$global:Client
27+
}
28+
Mock New-ServiceClient $scriptBlock -ModuleName $global:ModuleName
929
}
1030

1131
if (Test-Path "$PSScriptRoot\Override.ps1") {

src/StackAdmin/Azs.KeyVault.Admin/Tests/src/Quota.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ InModuleScope Azs.KeyVault.Admin {
5353
BeforeEach {
5454
}
5555

56+
AfterEach {
57+
$global:Client = $null
58+
}
59+
5660

5761
it "TestListQuotas" -Skip:$('TestListQuotas' -in $global:SkippedTests) {
5862
$global:TestName = 'TestListQuotas'

0 commit comments

Comments
 (0)