Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save moiaune/9161c89c99935db9cfc150b67ce41c09 to your computer and use it in GitHub Desktop.
Save moiaune/9161c89c99935db9cfc150b67ce41c09 to your computer and use it in GitHub Desktop.
$requiredModules = @("Az.Accounts", "Az.Resources")
foreach ($module in $requiredModules) {
$isLoaded = Get-Module -Name $module
if ($isLoaded) {
Write-Verbose -Message "$($module) module is loaded."
} else {
Write-Error -Message "$($module) module is not loaded, please install by 'Install-Module $($module)'."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment