Skip to content

Commit 01a1443

Browse files
committed
Merge branch 'main' of https://github.com/Azure/azure-powershell into nanxiang/Az.ConnectedKubernetes
2 parents 06c1097 + 54a771d commit 01a1443

File tree

2,622 files changed

+359650
-19111
lines changed

Some content is hidden

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

2,622 files changed

+359650
-19111
lines changed

documentation/azure-powershell-modules.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Marketplace Ordering | `Az.MarketplaceOrdering`
105105
Media | `Az.Media` | [![Media]][MediaGallery]
106106
Migrate | `Az.Migrate` | [![Migrate]][MigrateGallery]
107107
Mixed Reality | `Az.MixedReality` | [![MixedReality]][MixedRealityGallery]
108+
Mobile Network | `Az.MobileNetwork` | [![MobileNetwork]][MobileNetworkGallery]
108109
Monitor | `Az.Monitor` | [![Monitor]][MonitorGallery]
109110
Monitoring Solutions | `Az.MonitoringSolutions` | [![MonitoringSolutions]][MonitoringSolutionsGallery]
110111
Database for MySQL | `Az.MySql` | [![MySql]][MySqlGallery]
@@ -257,6 +258,7 @@ Windows Iot Services | `Az.WindowsIotServices`
257258
[Media]: https://img.shields.io/powershellgallery/v/Az.Media.svg?style=flat-square&label=Az.Media
258259
[Migrate]: https://img.shields.io/powershellgallery/v/Az.Migrate.svg?style=flat-square&label=Az.Migrate
259260
[MixedReality]: https://img.shields.io/powershellgallery/v/Az.MixedReality.svg?style=flat-square&label=Az.MixedReality
261+
[MobileNetwork]: https://img.shields.io/powershellgallery/v/Az.MobileNetwork.svg?style=flat-square&label=Az.MobileNetwork
260262
[Monitor]: https://img.shields.io/powershellgallery/v/Az.Monitor.svg?style=flat-square&label=Az.Monitor
261263
[MonitoringSolutions]: https://img.shields.io/powershellgallery/v/Az.MonitoringSolutions.svg?style=flat-square&label=Az.MonitoringSolutions
262264
[MySql]: https://img.shields.io/powershellgallery/v/Az.MySql.svg?style=flat-square&label=Az.MySql
@@ -407,6 +409,7 @@ Windows Iot Services | `Az.WindowsIotServices`
407409
[MediaGallery]: https://www.powershellgallery.com/packages/Az.Media/
408410
[MigrateGallery]: https://www.powershellgallery.com/packages/Az.Migrate/
409411
[MixedRealityGallery]: https://www.powershellgallery.com/packages/Az.MixedReality/
412+
[MobileNetworkGallery]: https://www.powershellgallery.com/packages/Az.MobileNetwork/
410413
[MonitorGallery]: https://www.powershellgallery.com/packages/Az.Monitor/
411414
[MonitoringSolutionsGallery]: https://www.powershellgallery.com/packages/Az.MonitoringSolutions/
412415
[MySqlGallery]: https://www.powershellgallery.com/packages/Az.MySql/

src/Accounts/Accounts/Az.Accounts.psd1

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 1/6/2023
6+
# Generated on: 1/12/2023
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.11.0'
15+
ModuleVersion = '2.11.1'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -147,11 +147,7 @@ PrivateData = @{
147147
# IconUri = ''
148148

149149
# ReleaseNotes of this module
150-
ReleaseNotes = '* Supported Web Account Manager (WAM) as an opt-in interactive login experience. Enable it by ''Update-AzConfig -EnableLoginByWam True''.
151-
* Optimized the mechanism for assembly loading.
152-
* Enabled AzKeyStore with keyring in Linux.
153-
* Fixed a typo in GetAzureRmContextAutosaveSetting.cs changing the cmdlet class name to GetAzureRmContextAutosaveSetting
154-
* Removed survey on error message in ''Resolve-AzError''. [#20398]'
150+
ReleaseNotes = '* Fixed an issue where Az.Accounts cannot be imported correctly. [#20615]'
155151

156152
# Prerelease string of this module
157153
# Prerelease = ''

src/Accounts/Accounts/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
## Upcoming Release
2222

23+
## Version 2.11.1
24+
* Fixed an issue where Az.Accounts cannot be imported correctly. [#20615]
25+
2326
## Version 2.11.0
2427
* Supported Web Account Manager (WAM) as an opt-in interactive login experience. Enable it by `Update-AzConfig -EnableLoginByWam $true`.
2528
* Optimized the mechanism for assembly loading.

src/Accounts/Accounts/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
// You can specify all the values or you can default the Build and Revision Numbers
4444
// by using the '*' as shown below:
4545

46-
[assembly: AssemblyVersion("2.11.0")]
47-
[assembly: AssemblyFileVersion("2.11.0")]
46+
[assembly: AssemblyVersion("2.11.1")]
47+
[assembly: AssemblyFileVersion("2.11.1")]
4848
#if !SIGN
4949
[assembly: InternalsVisibleTo("Microsoft.Azure.PowerShell.Cmdlets.Accounts.Test")]
5050
#endif

src/Accounts/Accounts/StartupScripts/InitializeAssemblyResolver.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
$assemblyRootPath = [System.IO.Path]::Combine($PSScriptRoot, "..", "lib")
2-
$conditionalAssemblyContext = [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyContext]::new($Host.Version)
2+
Write-Debug "Initializing ConditionalAssemblyContext. PSEdition is [$($PSVersionTable.PSEdition)]. PSVersion is [$($PSVersionTable.PSVersion)]."
3+
$conditionalAssemblyContext = [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyContext]::new($PSVersionTable.PSEdition, $PSVersionTable.PSVersion)
4+
Write-Debug "Initializing ConditionalAssemblyProvider. AssemblyRootPath is [$assemblyRootPath]."
35
[Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::Initialize($assemblyRootPath, $conditionalAssemblyContext)
46

57
if ($PSEdition -eq 'Desktop') {

src/Accounts/AssemblyLoading.Test/Mocks/MockConditionalAssemblyContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace Microsoft.Azure.PowerShell.AssemblyLoading.Test.Mocks
1919
{
2020
internal class MockConditionalAssemblyContext : IConditionalAssemblyContext
2121
{
22+
public string PSEdition { get; set; }
2223
public Version PSVersion { get; set; }
2324
public Architecture OSArchitecture { get; set; }
2425
public OSPlatform OS { get; set; }

src/Accounts/AssemblyLoading.Test/UnitTests/ConditionalAssemblyExtensionsTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public void CanWorkWithPSVersion()
2828
{
2929
var windowsPSContext = new MockConditionalAssemblyContext()
3030
{
31+
PSEdition = Constants.PSEditionDesktop,
3132
PSVersion = Version.Parse("5.1.22621.608")
3233
};
3334
var windowsPSAssembly = new MockConditionalAssembly(windowsPSContext)
@@ -40,6 +41,7 @@ public void CanWorkWithPSVersion()
4041

4142
var ps7Context = new MockConditionalAssemblyContext()
4243
{
44+
PSEdition = Constants.PSEditionCore,
4345
PSVersion = Version.Parse("7.3.0")
4446
};
4547
windowsPSAssembly = new MockConditionalAssembly(
@@ -52,6 +54,23 @@ public void CanWorkWithPSVersion()
5254
Assert.False(windowsPSAssembly.ShouldLoad);
5355
}
5456

57+
[Fact]
58+
[Trait(Category.AcceptanceType, Category.CheckIn)]
59+
public void CanWorkWithEmptyPSEdition()
60+
{
61+
var windowsPSContext = new MockConditionalAssemblyContext()
62+
{
63+
PSVersion = Version.Parse("1.0.0.0")
64+
};
65+
var windowsPSAssembly = new MockConditionalAssembly(windowsPSContext)
66+
.WithWindowsPowerShell();
67+
var psCoreAssembly = new MockConditionalAssembly(
68+
windowsPSContext)
69+
.WithPowerShellCore();
70+
Assert.True(windowsPSAssembly.ShouldLoad);
71+
Assert.False(psCoreAssembly.ShouldLoad);
72+
}
73+
5574
[Fact]
5675
[Trait(Category.AcceptanceType, Category.CheckIn)]
5776
public void CanWorkWithOS()

src/Accounts/AssemblyLoading.Test/UnitTests/ConditionalAssemblyProviderTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public void CanGetAssembliesOnWindowsPowerShell()
3535
var context = new MockConditionalAssemblyContext()
3636
{
3737
OS = OSPlatform.Windows,
38+
PSEdition = Constants.PSEditionDesktop,
3839
PSVersion = Version.Parse("5.1.22621.608"),
3940
OSArchitecture = Architecture.X64
4041
};
@@ -57,6 +58,7 @@ public void CanGetAssembliesOnPowerShellCorePlus()
5758
var context = new MockConditionalAssemblyContext()
5859
{
5960
OS = OSPlatform.Windows,
61+
PSEdition = Constants.PSEditionCore,
6062
PSVersion = Version.Parse("7.3.0"),
6163
OSArchitecture = Architecture.X64
6264
};

src/Accounts/AssemblyLoading.Test/UnitTests/ConditionalAssemblyTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public void ShouldLoadAssemblyAccordingToPSVersion()
3737
{
3838
// windows powershell
3939
var context = new MockConditionalAssemblyContext()
40-
{ PSVersion = Version.Parse("5.1.22621.608") };
40+
{
41+
PSEdition = Constants.PSEditionDesktop,
42+
PSVersion = Version.Parse("5.1.22621.608")
43+
};
4144
var windowsPSAssembly = NewDummyAssembly(context).WithWindowsPowerShell();
4245
var psCoreAssembly = NewDummyAssembly(context).WithPowerShellCore();
4346
var neturalAssembly = NewDummyAssembly(context);
@@ -46,6 +49,7 @@ public void ShouldLoadAssemblyAccordingToPSVersion()
4649
Assert.True(neturalAssembly.ShouldLoad);
4750

4851
// powershell core and 7+
52+
context.PSEdition = Constants.PSEditionCore;
4953
context.PSVersion = Version.Parse("7.3.0");
5054
windowsPSAssembly = NewDummyAssembly(context).WithWindowsPowerShell();
5155
psCoreAssembly = NewDummyAssembly(context).WithPowerShellCore();

src/Accounts/AssemblyLoading/ConditionalAssemblyContext.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ namespace Microsoft.Azure.PowerShell.AssemblyLoading
2020
/// <inheritdoc/>
2121
public class ConditionalAssemblyContext : IConditionalAssemblyContext
2222
{
23-
public ConditionalAssemblyContext(Version psVersion)
23+
public ConditionalAssemblyContext(string psEdition, Version psVersion)
2424
{
25+
PSEdition = psEdition;
2526
PSVersion = psVersion;
2627
}
2728

29+
/// <inheritdoc/>
30+
public string PSEdition { get; private set; }
31+
2832
/// <inheritdoc/>
2933
public Version PSVersion { get; private set; }
3034

0 commit comments

Comments
 (0)