Skip to content

Instantly share code, notes, and snippets.

@markryd
Created June 7, 2016 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markryd/5a62d9482670c6dbda0532f5feb3bbeb to your computer and use it in GitHub Desktop.
Save markryd/5a62d9482670c6dbda0532f5feb3bbeb to your computer and use it in GitHub Desktop.
Benchmark Azure RM Powershell loading
#CHANGE ME!
$OctopusAzureModulePath = "C:\Octopus\master\Calamari\Azure\1.0.20160602.084032\AzurePowershell"
$AzureRMModules = @(
"AzureRM.ApiManagement",
"AzureRM.Automation",
"AzureRM.Backup",
"AzureRM.Batch",
"AzureRM.Compute",
"AzureRM.DataFactories",
"AzureRM.DataLakeAnalytics",
"AzureRM.DataLakeStore",
"AzureRM.Dns",
"AzureRM.HDInsight",
"AzureRM.Insights",
"AzureRM.KeyVault",
"AzureRM.Network",
"AzureRM.NotificationHubs",
"AzureRM.OperationalInsights",
"AzureRM.RecoveryServices",
"AzureRM.RedisCache",
"AzureRM.Resources",
"AzureRM.SiteRecovery",
"AzureRM.Sql",
"AzureRM.Storage",
"AzureRM.StreamAnalytics",
"AzureRM.Tags",
"AzureRM.TrafficManager",
"AzureRM.UsageAggregates",
"AzureRM.Websites"
)
$ResourceManagerModulePath = [IO.Path]::Combine("$OctopusAzureModulePath", "ResourceManager", "AzureResourceManager")
$sw = [Diagnostics.Stopwatch]::StartNew()
Import-Module -Name ([IO.Path]::Combine($ResourceManagerModulePath, "AzureRM.Profile"))
Write-Host "AzureRM.Profile "$sw.Elapsed
$sw.ReStart()
Import-Module -Name ([IO.Path]::Combine($ResourceManagerModulePath, "Azure.Storage"))
Write-Host "Azure.Storage "$sw.Elapsed
$sw.ReStart()
$AzureRMModules | ForEach {
Import-Module -Name ([IO.Path]::Combine($ResourceManagerModulePath, $_))
Write-Host "$_ "$sw.Elapsed
$sw.ReStart()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment