This commit is contained in:
maddieclayton 2018-10-31 16:58:46 -07:00
Родитель b30d6df7cb
Коммит 3aa2df101c
3 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -31,5 +31,5 @@ else
if (Get-Module AzureRM.profile)
{
Write-Warning "Both Az and AzureRM modules were detected on your machine. Az and AzureRM module cannot be run side-by-side, please follow migration guide to ensure Az modules work as expected: <LINK HERE>."
throw "Import failed."
throw "Both Az and AzureRM modules were detected on your machine. Az and AzureRM module cannot be run side-by-side, please follow migration guide to ensure Az modules work as expected: <LINK HERE>."
}

Просмотреть файл

@ -28,8 +28,8 @@ else
}
}
if (Get-Module Az.Profile)
if (Get-Module AzureRM.profile)
{
Write-Warning "Both Az and AzureRM modules were detected on your machine. Az and AzureRM module cannot be run side-by-side, please follow migration guide to ensure Az modules work as expected: <LINK HERE>."
throw "Import failed."
throw "Both Az and AzureRM modules were detected on your machine. Az and AzureRM module cannot be run side-by-side, please follow migration guide to ensure Az modules work as expected: <LINK HERE>."
}

Просмотреть файл

@ -9,12 +9,19 @@
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
if (Test-Path -Path "$PSScriptRoot\StartupScripts")
try
{
Get-ChildItem "$PSScriptRoot\StartupScripts" | ForEach-Object {
. $_.FullName
if (Test-Path -Path "$PSScriptRoot\StartupScripts")
{
Get-ChildItem "$PSScriptRoot\StartupScripts" | ForEach-Object {
. $_.FullName
}
}
}
catch
{
throw "Both Az and AzureRM modules were detected on your machine. Az and AzureRM module cannot be run side-by-side, please follow migration guide to ensure Az modules work as expected: <LINK HERE>."
}
$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies")
if($PSEdition -eq 'Desktop' -and (Test-Path $preloadPath))