Skip to content

Commit 4e8640b

Browse files
authored
Merge pull request #6555 from deathly809/PageBugFix
[Azure Stack] Bug Fixes and cleanup
2 parents 3931dd5 + f3417b3 commit 4e8640b

File tree

120 files changed

+2550
-668
lines changed

Some content is hidden

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

120 files changed

+2550
-668
lines changed

src/StackAdmin/Azs.AzureBridge.Admin/Module/Azs.AzureBridge.Admin.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build"
2+
<Project ToolsVersion="12.0" DefaultTargets="Build"
33
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
55
<PropertyGroup>
@@ -65,4 +65,4 @@
6565
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
6666
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
6767
</Target>
68-
</Project>
68+
</Project>

src/StackAdmin/Azs.AzureBridge.Admin/Module/Azs.AzureBridge.Admin/Azs.Azurebridge.Admin.psd1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Licensed under the MIT License. See License.txt in the project root for license
66
#
77
# Module manifest for module 'Azs.Azurebridge.Admin'
88
#
9-
# Generated by: viananth
9+
# Generated by: Microsoft
1010
#
1111
# Generated on: 2/13/2018
1212
#
@@ -17,7 +17,7 @@ Licensed under the MIT License. See License.txt in the project root for license
1717
RootModule = 'Azs.Azurebridge.Admin.psm1'
1818

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

2222
# Supported PSEditions
2323
# CompatiblePSEditions = @()
@@ -26,13 +26,13 @@ Licensed under the MIT License. See License.txt in the project root for license
2626
GUID = '82d2260a-95ae-44bb-af8b-afd67d38f6db'
2727

2828
# Author of this module
29-
Author = 'viananth'
29+
Author = 'Microsoft'
3030

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

3434
# Copyright statement for this module
35-
Copyright = '(c) 2018 viananth. All rights reserved.'
35+
Copyright = '(c) 2018 Microsoft. All rights reserved.'
3636

3737
# Description of the functionality provided by this module
3838
Description = 'AzureBridge Admin Client'

src/StackAdmin/Azs.AzureBridge.Admin/Module/Azs.AzureBridge.Admin/Azs.Azurebridge.Admin.psm1

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,8 @@ Microsoft.PowerShell.Core\Set-StrictMode -Version Latest
77

88
Write-Warning "Preview version of the module Azs.Azurebridge.Admin loaded. Future release of this module may have breaking changes."
99

10-
# If the user supplied -Prefix to Import-Module, that applies to the nested module as well
11-
# Force import the nested module again without -Prefix
12-
if (-not (Get-Command Get-OperatingSystemInfo -Module PSSwaggerUtility -ErrorAction Ignore)) {
13-
# Simply doing "Import-Module PSSwaggerUtility" doesn't work for local case
14-
if (Test-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath PSSwaggerUtility)) {
15-
Import-Module (Join-Path -Path $PSScriptRoot -ChildPath PSSwaggerUtility) -Force
16-
} else {
17-
Import-Module PSSwaggerUtility -Force
18-
}
19-
}
10+
# We always import embedded version.
11+
Import-Module (Join-Path -Path $PSScriptRoot -ChildPath PSSwaggerUtility) -Force
2012

2113
if ((Get-OperatingSystemInfo).IsCore) {
2214
$clr = 'coreclr'

src/StackAdmin/Azs.AzureBridge.Admin/Module/Azs.AzureBridge.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Get-AzsAzureBridgeActivation.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ function Get-AzsAzureBridgeActivation {
143143
Get-TaskResult @GetTaskResult_params
144144

145145
Write-Verbose -Message 'Flattening paged results.'
146-
while ($PageResult -and $PageResult.Result -and (Get-Member -InputObject $PageResult.Result -Name 'nextLink') -and $PageResult.Result.'nextLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
147-
$PageResult.Result = $null
148-
Write-Debug -Message "Retrieving next page: $($PageResult.Result.'nextLink')"
149-
$TaskResult = $AzureBridgeAdminClient.Activations.ListNextWithHttpMessagesAsync($PageResult.Result.'nextLink')
146+
while ($PageResult -and (Get-Member -InputObject $PageResult -Name Page) -and (Get-Member -InputObject $PageResult.Page -Name 'nextPageLink') -and $PageResult.Page.'nextPageLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
147+
Write-Debug -Message "Retrieving next page: $($PageResult.Page.'nextPageLink')"
148+
$TaskResult = $AzureBridgeAdminClient.Activations.ListNextWithHttpMessagesAsync($PageResult.Page.'nextPageLink')
149+
$PageResult.Page = $null
150150
$GetTaskResult_params['TaskResult'] = $TaskResult
151151
$GetTaskResult_params['PageResult'] = $PageResult
152152
Get-TaskResult @GetTaskResult_params

src/StackAdmin/Azs.AzureBridge.Admin/Module/Azs.AzureBridge.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Get-AzsAzureBridgeDownloadedProduct.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ function Get-AzsAzureBridgeDownloadedProduct {
153153
Get-TaskResult @GetTaskResult_params
154154

155155
Write-Verbose -Message 'Flattening paged results.'
156-
while ($PageResult -and $PageResult.Result -and (Get-Member -InputObject $PageResult.Result -Name 'nextLink') -and $PageResult.Result.'nextLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
157-
$PageResult.Result = $null
158-
Write-Debug -Message "Retrieving next page: $($PageResult.Result.'nextLink')"
159-
$TaskResult = $AzureBridgeAdminClient.DownloadedProducts.ListNextWithHttpMessagesAsync($PageResult.Result.'nextLink')
156+
while ($PageResult -and (Get-Member -InputObject $PageResult -Name Page) -and (Get-Member -InputObject $PageResult.Page -Name 'nextPageLink') -and $PageResult.Page.'nextPageLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
157+
Write-Debug -Message "Retrieving next page: $($PageResult.Page.'nextPageLink')"
158+
$TaskResult = $AzureBridgeAdminClient.DownloadedProducts.ListNextWithHttpMessagesAsync($PageResult.Page.'nextPageLink')
159+
$PageResult.Page = $null
160160
$GetTaskResult_params['TaskResult'] = $TaskResult
161161
$GetTaskResult_params['PageResult'] = $PageResult
162162
Get-TaskResult @GetTaskResult_params

src/StackAdmin/Azs.AzureBridge.Admin/Module/Azs.AzureBridge.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Get-AzsAzureBridgeProduct.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ function Get-AzsAzureBridgeProduct {
154154
Get-TaskResult @GetTaskResult_params
155155

156156
Write-Verbose -Message 'Flattening paged results.'
157-
while ($PageResult -and $PageResult.Result -and (Get-Member -InputObject $PageResult.Result -Name 'nextLink') -and $PageResult.Result.'nextLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
158-
$PageResult.Result = $null
159-
Write-Debug -Message "Retrieving next page: $($PageResult.Result.'nextLink')"
160-
$TaskResult = $AzureBridgeAdminClient.Products.ListNextWithHttpMessagesAsync($PageResult.Result.'nextLink')
157+
while ($PageResult -and (Get-Member -InputObject $PageResult -Name Page) -and (Get-Member -InputObject $PageResult.Page -Name 'nextPageLink') -and $PageResult.Page.'nextPageLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
158+
Write-Debug -Message "Retrieving next page: $($PageResult.Page.'nextPageLink')"
159+
$TaskResult = $AzureBridgeAdminClient.Products.ListNextWithHttpMessagesAsync($PageResult.Page.'nextPageLink')
160+
$PageResult.Page = $null
161161
$GetTaskResult_params['TaskResult'] = $TaskResult
162162
$GetTaskResult_params['PageResult'] = $PageResult
163163
Get-TaskResult @GetTaskResult_params

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Microsoft.PowerShell.Core\Set-StrictMode -Version Latest
77

88
<#
99
.DESCRIPTION
10-
Get zero or more result items from a task. Optionally, skip N items or take only the top N items. If paged, assigns $PageResult.Result
10+
Get zero or more result items from a task. Optionally, skip N items or take only the top N items. If paged, assigns $PageResult.Page
1111
the page item result, and the returned result items are the items within the page.
1212
1313
.PARAMETER TaskResult

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build"
2+
<Project ToolsVersion="14.0" DefaultTargets="Build"
33
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
55
<PropertyGroup>
@@ -71,4 +71,4 @@
7171
</ItemGroup>
7272
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7373
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
74-
</Project>
74+
</Project>

src/StackAdmin/Azs.Backup.Admin/Module/Azs.Backup.Admin.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build"
2+
<Project ToolsVersion="12.0" DefaultTargets="Build"
33
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
55
<PropertyGroup>
@@ -40,8 +40,8 @@
4040
<Prefer32Bit>false</Prefer32Bit>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="Microsoft.AzureStack.Management.Admin.Backup, Version=0.1.0-preview">
44-
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Backup.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Backup.Admin.dll</HintPath>
43+
<Reference Include="Microsoft.AzureStack.Management.Admin.Backup, Version=0.2.0-preview">
44+
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Backup.Admin.0.2.0-preview\lib\net452\Microsoft.AzureStack.Management.Backup.Admin.dll</HintPath>
4545
</Reference>
4646
</ItemGroup>
4747
<ItemGroup>
@@ -65,4 +65,4 @@
6565
<Copy ContinueOnError='true' SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
6666
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
6767
</Target>
68-
</Project>
68+
</Project>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Changes may cause incorrect behavior and will be lost if the code is regenerated
3131
RootModule = 'Azs.Backup.Admin.psm1'
3232

3333
# Version number of this module.
34-
ModuleVersion = '0.1.0'
34+
ModuleVersion = '0.1.1'
3535

3636
# Supported PSEditions
3737
# CompatiblePSEditions = @()
@@ -90,7 +90,7 @@ Changes may cause incorrect behavior and will be lost if the code is regenerated
9090

9191
# 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.
9292
FunctionsToExport = 'Get-AzsBackupLocation', 'Get-AzsBackup', 'Restore-AzsBackup',
93-
'Set-AzsBackupShare', 'Start-AzsBackup'
93+
'Set-AzsBackupShare', 'Start-AzsBackup', "New-EncryptionKeyBase64"
9494

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

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,8 @@ Microsoft.PowerShell.Core\Set-StrictMode -Version Latest
77

88
Write-Warning "Preview version of the module Azs.Backup.Admin loaded. Future release of this module may have breaking changes."
99

10-
# If the user supplied -Prefix to Import-Module, that applies to the nested module as well
11-
# Force import the nested module again without -Prefix
12-
if (-not (Get-Command Get-OperatingSystemInfo -Module PSSwaggerUtility -ErrorAction Ignore)) {
13-
# Simply doing "Import-Module PSSwaggerUtility" doesn't work for local case
14-
if (Test-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath PSSwaggerUtility)) {
15-
Import-Module (Join-Path -Path $PSScriptRoot -ChildPath PSSwaggerUtility) -Force
16-
} else {
17-
Import-Module PSSwaggerUtility -Force
18-
}
19-
}
10+
# We always import embedded version.
11+
Import-Module (Join-Path -Path $PSScriptRoot -ChildPath PSSwaggerUtility) -Force
2012

2113
if ((Get-OperatingSystemInfo).IsCore) {
2214
$clr = 'coreclr'

src/StackAdmin/Azs.Backup.Admin/Module/Azs.Backup.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Get-AzsBackup.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ function Get-AzsBackup {
175175
Get-TaskResult @GetTaskResult_params
176176

177177
Write-Verbose -Message 'Flattening paged results.'
178-
while ($PageResult -and $PageResult.Result -and (Get-Member -InputObject $PageResult.Result -Name 'nextLink') -and $PageResult.Result.'nextLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
179-
$PageResult.Result = $null
180-
Write-Debug -Message "Retrieving next page: $($PageResult.Result.'nextLink')"
181-
$TaskResult = $BackupAdminClient.Backups.ListNextWithHttpMessagesAsync($PageResult.Result.'nextLink')
178+
while ($PageResult -and (Get-Member -InputObject $PageResult -Name Page) -and (Get-Member -InputObject $PageResult.Page -Name 'nextPageLink') -and $PageResult.Page.'nextPageLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
179+
Write-Debug -Message "Retrieving next page: $($PageResult.Page.'nextPageLink')"
180+
$TaskResult = $BackupAdminClient.Backups.ListNextWithHttpMessagesAsync($PageResult.Page.'nextPageLink')
181+
$PageResult.Page = $null
182182
$GetTaskResult_params['TaskResult'] = $TaskResult
183183
$GetTaskResult_params['PageResult'] = $PageResult
184184
Get-TaskResult @GetTaskResult_params

src/StackAdmin/Azs.Backup.Admin/Module/Azs.Backup.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Get-AzsBackupLocation.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ function Get-AzsBackupLocation {
144144
Get-TaskResult @GetTaskResult_params
145145

146146
Write-Verbose -Message 'Flattening paged results.'
147-
while ($PageResult -and $PageResult.Result -and (Get-Member -InputObject $PageResult.Result -Name 'nextLink') -and $PageResult.Result.'nextLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
148-
$PageResult.Result = $null
149-
Write-Debug -Message "Retrieving next page: $($PageResult.Result.'nextLink')"
150-
$TaskResult = $BackupAdminClient.BackupLocations.ListNextWithHttpMessagesAsync($PageResult.Result.'nextLink')
147+
while ($PageResult -and (Get-Member -InputObject $PageResult -Name Page) -and (Get-Member -InputObject $PageResult.Page -Name 'nextPageLink') -and $PageResult.Page.'nextPageLink' -and (($TopInfo -eq $null) -or ($TopInfo.Max -eq -1) -or ($TopInfo.Count -lt $TopInfo.Max))) {
148+
Write-Debug -Message "Retrieving next page: $($PageResult.Page.'nextPageLink')"
149+
$TaskResult = $BackupAdminClient.BackupLocations.ListNextWithHttpMessagesAsync($PageResult.Page.'nextPageLink')
150+
$PageResult.Page = $null
151151
$GetTaskResult_params['TaskResult'] = $TaskResult
152152
$GetTaskResult_params['PageResult'] = $PageResult
153153
Get-TaskResult @GetTaskResult_params
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<#
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the MIT License. See License.txt in the project root for license information.
4+
#>
5+
6+
<#
7+
.SYNOPSIS
8+
Generate encryption key for infrastructure backups.
9+
10+
.DESCRIPTION
11+
Generate encryption key for infrastructure backups.
12+
13+
.EXAMPLE
14+
15+
PS C:\>New-EncryptionKeyBase64
16+
17+
Generate encryption key for infrastructure backups.
18+
19+
#>
20+
function New-EncryptionKeyBase64
21+
{
22+
$tempEncryptionKeyString = ""
23+
foreach($i in 1..64) { $tempEncryptionKeyString += -join ((65..90) + (97..122) | Get-Random | % {[char]$_}) }
24+
$tempEncryptionKeyBytes = [System.Text.Encoding]::UTF8.GetBytes($tempEncryptionKeyString)
25+
$BackupEncryptionKeyBase64 = [System.Convert]::ToBase64String($tempEncryptionKeyBytes)
26+
return $BackupEncryptionKeyBase64
27+
}

0 commit comments

Comments
 (0)