Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tools/AzureRM.Example.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ if (%ISAZMODULE% -and ($PSEdition -eq 'Desktop'))
Test-DotNet
}

%AZURECOREPREREQUISITE%

if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore)
{
Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object {
Expand All @@ -60,7 +62,7 @@ if($PSEdition -eq 'Desktop' -and (Test-Path $preloadPath -ErrorAction Ignore))
Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null
}
catch {
Write-Warning $_
Write-Verbose $_
}
}
}
Expand All @@ -83,7 +85,7 @@ if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore))
Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null
}
catch {
Write-Warning $_
Write-Verbose $_
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions tools/UpdateModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ function New-ModulePsm1 {
$template = $template -replace "%DATE%", [string](Get-Date)
$template = $template -replace "%IMPORTED-DEPENDENCIES%", $importedModules

#Az.Storage is using Azure.Core, so need to check PS version
if ($IsNetcore -and $file.BaseName -eq 'Az.Storage')
{
$template = $template -replace "%AZURECOREPREREQUISITE%",
@"
if (%ISAZMODULE% -and (`$PSEdition -eq 'Core'))
{
if (`$PSVersionTable.PSVersion -lt [Version]'6.2.4')
{
throw "Az.Storage doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher."
}
}
"@
}
else
{
$template = $template -replace "%AZURECOREPREREQUISITE%", ""
}
# Replace Az or AzureRM with correct information
if ($IsNetcore)
{
Expand Down