File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ if (%ISAZMODULE% -and ($PSEdition -eq 'Desktop'))
34
34
Test-DotNet
35
35
}
36
36
37
+ % AZURECOREPREREQUISITE%
38
+
37
39
if (Test-Path - Path " $PSScriptRoot \StartupScripts" - ErrorAction Ignore)
38
40
{
39
41
Get-ChildItem " $PSScriptRoot \StartupScripts" - ErrorAction Stop | ForEach-Object {
@@ -60,7 +62,7 @@ if($PSEdition -eq 'Desktop' -and (Test-Path $preloadPath -ErrorAction Ignore))
60
62
Add-Type - Path $_.FullName - ErrorAction Ignore | Out-Null
61
63
}
62
64
catch {
63
- Write-Warning $_
65
+ Write-Verbose $_
64
66
}
65
67
}
66
68
}
@@ -83,7 +85,7 @@ if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore))
83
85
Add-Type - Path $_.FullName - ErrorAction Ignore | Out-Null
84
86
}
85
87
catch {
86
- Write-Warning $_
88
+ Write-Verbose $_
87
89
}
88
90
}
89
91
}
Original file line number Diff line number Diff line change @@ -95,6 +95,24 @@ function New-ModulePsm1 {
95
95
$template = $template -replace " %DATE%" , [string ](Get-Date )
96
96
$template = $template -replace " %IMPORTED-DEPENDENCIES%" , $importedModules
97
97
98
+ # Az.Storage is using Azure.Core, so need to check PS version
99
+ if ($IsNetcore -and $file.BaseName -eq ' Az.Storage' )
100
+ {
101
+ $template = $template -replace " %AZURECOREPREREQUISITE%" ,
102
+ @"
103
+ if (%ISAZMODULE% -and (`$ PSEdition -eq 'Core'))
104
+ {
105
+ if (`$ PSVersionTable.PSVersion -lt [Version]'6.2.4')
106
+ {
107
+ throw "Az.Storage doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher."
108
+ }
109
+ }
110
+ "@
111
+ }
112
+ else
113
+ {
114
+ $template = $template -replace " %AZURECOREPREREQUISITE%" , " "
115
+ }
98
116
# Replace Az or AzureRM with correct information
99
117
if ($IsNetcore )
100
118
{
You can’t perform that action at this time.
0 commit comments