Azure.ps1

function Init-Azure() {

  if (-Not (Get-Command Get-AzPublicIpAddress -errorAction SilentlyContinue)) {
    Write-Host("Installing Azure Modules")
    Install-PackageProvider -Name NuGet -Scope CurrentUser 
    Install-Module -Name Az.Resources -MaximumVersion 6.6.0 -Scope CurrentUser -Repository PSGallery
    Install-Module -Name Az.Accounts -MaximumVersion 2.12.1 -Scope CurrentUser -Repository PSGallery
    Install-Module -Name Az.Network -Scope CurrentUser -Repository PSGallery
  }

  if ( -not (Get-AzContext -errorAction SilentlyContinue)) {
    Write-Host("Connect Azure Account")
    Connect-AzAccount
  }

  # TODO Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.
}
function New-AzureVM() {
  param(
    [string] $name
  )

  Init-Azure
  Write-Host "azure"
}