Az.psm1

#
# Script module for module 'Az' that is executed when 'Az' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 10/19/2018 00:46:25
#

$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest

$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies")
if($PSEdition -eq 'Desktop' -and (Test-Path $preloadPath))
{
    try
    {
        Get-ChildItem -Path $preloadPath -Filter "*.dll" | ForEach-Object {
            Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null
        }
    }
    catch {}
}

$netCorePath = (Join-Path $PSScriptRoot -ChildPath "NetCoreAssemblies")
if($PSEdition -eq 'Core' -and (Test-Path $netCorePath))
{
    try
    {
        $loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | %{New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} )
        Get-ChildItem -Path $netCorePath -Filter "*.dll" | ForEach-Object {
            $assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName))
            $matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name})
            if (-not $matches)
            {
                Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null
            }
        }
    }
    catch {}
}


$module = Get-Module Az.Profile 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Profile version 0.4.0. An earlier version of Az.Profile is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Profile -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Aks 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Aks version 0.4.0. An earlier version of Az.Aks is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Aks -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.AnalysisServices 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.AnalysisServices version 0.4.0. An earlier version of Az.AnalysisServices is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.AnalysisServices -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.ApiManagement 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.ApiManagement version 0.4.0. An earlier version of Az.ApiManagement is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.ApiManagement -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.ApplicationInsights 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.ApplicationInsights version 0.4.0. An earlier version of Az.ApplicationInsights is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.ApplicationInsights -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Automation 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Automation version 0.4.0. An earlier version of Az.Automation is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Automation -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Batch 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Batch version 0.4.0. An earlier version of Az.Batch is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Batch -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Billing 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Billing version 0.4.0. An earlier version of Az.Billing is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Billing -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Cdn 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Cdn version 0.4.0. An earlier version of Az.Cdn is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Cdn -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.CognitiveServices 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.CognitiveServices version 0.4.0. An earlier version of Az.CognitiveServices is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.CognitiveServices -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Compute 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Compute version 0.4.0. An earlier version of Az.Compute is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Compute -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Consumption 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Consumption version 0.4.0. An earlier version of Az.Consumption is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Consumption -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.ContainerInstance 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.ContainerInstance version 0.4.0. An earlier version of Az.ContainerInstance is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.ContainerInstance -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.ContainerRegistry 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.ContainerRegistry version 0.4.0. An earlier version of Az.ContainerRegistry is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.ContainerRegistry -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.DataLakeAnalytics 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.DataLakeAnalytics version 0.4.0. An earlier version of Az.DataLakeAnalytics is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.DataLakeAnalytics -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.DataLakeStore 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.DataLakeStore version 0.4.0. An earlier version of Az.DataLakeStore is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.DataLakeStore -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.DevTestLabs 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.DevTestLabs version 0.4.0. An earlier version of Az.DevTestLabs is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.DevTestLabs -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Dns 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Dns version 0.4.0. An earlier version of Az.Dns is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Dns -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.EventGrid 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.EventGrid version 0.4.0. An earlier version of Az.EventGrid is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.EventGrid -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.EventHub 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.EventHub version 0.4.0. An earlier version of Az.EventHub is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.EventHub -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Insights 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Insights version 0.4.0. An earlier version of Az.Insights is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Insights -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.IotHub 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.IotHub version 0.4.0. An earlier version of Az.IotHub is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.IotHub -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.KeyVault 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.KeyVault version 0.4.0. An earlier version of Az.KeyVault is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.KeyVault -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.LogicApp 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.LogicApp version 0.4.0. An earlier version of Az.LogicApp is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.LogicApp -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.MachineLearning 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.MachineLearning version 0.4.0. An earlier version of Az.MachineLearning is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.MachineLearning -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.MachineLearningCompute 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.MachineLearningCompute version 0.4.0. An earlier version of Az.MachineLearningCompute is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.MachineLearningCompute -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.MarketplaceOrdering 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.MarketplaceOrdering version 0.4.0. An earlier version of Az.MarketplaceOrdering is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.MarketplaceOrdering -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Media 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Media version 0.4.0. An earlier version of Az.Media is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Media -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Network 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Network version 0.4.0. An earlier version of Az.Network is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Network -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.NotificationHubs 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.NotificationHubs version 0.4.0. An earlier version of Az.NotificationHubs is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.NotificationHubs -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.PolicyInsights 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.PolicyInsights version 0.4.0. An earlier version of Az.PolicyInsights is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.PolicyInsights -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.OperationalInsights 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.OperationalInsights version 0.4.0. An earlier version of Az.OperationalInsights is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.OperationalInsights -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.PowerBIEmbedded 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.PowerBIEmbedded version 0.4.0. An earlier version of Az.PowerBIEmbedded is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.PowerBIEmbedded -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.RecoveryServices 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.RecoveryServices version 0.4.0. An earlier version of Az.RecoveryServices is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.RecoveryServices -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.RedisCache 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.RedisCache version 0.4.0. An earlier version of Az.RedisCache is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.RedisCache -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Relay 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Relay version 0.4.0. An earlier version of Az.Relay is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Relay -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Resources 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Resources version 0.4.0. An earlier version of Az.Resources is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Resources -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.ServiceBus 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.ServiceBus version 0.4.0. An earlier version of Az.ServiceBus is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.ServiceBus -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.ServiceFabric 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.ServiceFabric version 0.4.0. An earlier version of Az.ServiceFabric is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.ServiceFabric -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.SignalR 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.SignalR version 0.4.0. An earlier version of Az.SignalR is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.SignalR -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Sql 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Sql version 0.4.0. An earlier version of Az.Sql is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Sql -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Storage 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Storage version 0.4.0. An earlier version of Az.Storage is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Storage -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.StreamAnalytics 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.StreamAnalytics version 0.4.0. An earlier version of Az.StreamAnalytics is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.StreamAnalytics -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Tags 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Tags version 0.4.0. An earlier version of Az.Tags is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Tags -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.TrafficManager 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.TrafficManager version 0.4.0. An earlier version of Az.TrafficManager is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.TrafficManager -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.UsageAggregates 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.UsageAggregates version 0.4.0. An earlier version of Az.UsageAggregates is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.UsageAggregates -MinimumVersion 0.4.0 -Scope Global 
}
$module = Get-Module Az.Websites 
if ($module -ne $null -and $module.Version.ToString().CompareTo("0.4.0") -lt 0) 
{ 
    Write-Error "This module requires Az.Websites version 0.4.0. An earlier version of Az.Websites is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information." -ErrorAction Stop 
} 
elseif ($module -eq $null) 
{ 
    Import-Module Az.Websites -MinimumVersion 0.4.0 -Scope Global 
}


if (Test-Path -Path "$PSScriptRoot\StartupScripts")
{
    Get-ChildItem "$PSScriptRoot\StartupScripts" | ForEach-Object {
        . $_.FullName
    }
}

$FilteredCommands = @()

if ($Env:ACC_CLOUD -eq $null)
{
    $FilteredCommands | ForEach-Object {

        $existingDefault = $false
        foreach ($key in $global:PSDefaultParameterValues.Keys)
        {
            if ($_ -like "$key")
                {
                $existingDefault = $true
                }
        }

        if (!$existingDefault)
        {
            $global:PSDefaultParameterValues.Add($_,
                {
                    if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null)
                    {
                        $context = Get-AzureRmContext
                    }
                    else
                    {
                        $context = Get-AzContext
                    }
                    if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) {
                        $context.ExtendedProperties["Default Resource Group"]
                    }
                })
        }
    }
}