Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Created November 25, 2019 15:40
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 pmatthews05/8170cf6dd7074f2c29bb986181a75e45 to your computer and use it in GitHub Desktop.
Save pmatthews05/8170cf6dd7074f2c29bb986181a75e45 to your computer and use it in GitHub Desktop.
#Install AzureAD
Write-Information -MessageData:"Getting if the AzureAD powershell module is available..."
if(-not (Get-Module AzureAD)) {
Write-Information -MessageData:"Installing the NuGet Package provider..."
Install-PackageProvider -Name:NuGet -Force -Scope:CurrentUser
Write-Information -MessageData:"Installing the AzureAD Powershell Module..."
Install-Module AzureAD -Scope:CurrentUser -Force
}
$Credential = Get-Credential
Connect-AzureAD -Credential $Credential
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment