Skip to content

Commit 2952e0b

Browse files
committed
BugFix to only import nested PSSwaggerUtility
1 parent 8d18fa7 commit 2952e0b

File tree

13 files changed

+26
-130
lines changed

13 files changed

+26
-130
lines changed

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.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.Commerce.Admin/Module/Azs.Commerce.Admin/Azs.Commerce.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.Commerce.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.Compute.Admin/Module/Azs.Compute.Admin/Azs.Compute.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.Compute.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.Fabric.Admin/Module/Azs.Fabric.Admin/Azs.Fabric.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.Fabric.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.Gallery.Admin/Module/Azs.Gallery.Admin/Azs.Gallery.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.Gallery.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.InfrastructureInsights.Admin/Module/Azs.InfrastructureInsights.Admin/Azs.Infrastructureinsights.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.Infrastructureinsights.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.KeyVault.Admin/Module/Azs.KeyVault.Admin/Azs.Keyvault.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.Keyvault.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.Network.Admin/Module/Azs.Network.Admin/Azs.Network.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.Netowrk.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.Storage.Admin/Module/Azs.Storage.Admin/Azs.Storage.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.Storage.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.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Azs.Subscriptions.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.Subscriptions.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.Subscriptions/Module/Azs.Subscriptions/Azs.Subscriptions.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.Subscriptions 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.Update.Admin/Module/Azs.Update.Admin/Azs.Update.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.Update.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'

0 commit comments

Comments
 (0)