Suatu ketika saya menggunakan dekstop Ubuntu untuk melakukan pekerjaan kantor, sekedar selingan saja. Dan kebetulan juga akhir-akhir ini sedang banyak belajar Azure AD, jadi saya mencoba install PowerShell di Ubuntu.
Tapi pada saat hendak tersambung ke Azure AD melalui PowerShell melalui perintah Connect-AzureAD, saya mendapati error:
Connect-azuread: The term 'Connect-azuread' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Padahal saya yakin sekali module cmdlet AzureAD sudah diinstall dan dapat dikonfirmasi:

dan juga sudah dilakukan Import-Module dan dapat dikonfirmasi:
PS /home/godril> Import-Module AzureAD Import-Module: Assembly with same name is already loaded
Troubleshoot
Setelah browsing ke sana ke mari akhirnya nemu petunjuk bagaimana menjalankan cmdlet AzureAD di Ubuntu. Yaitu dengan meregister gallery berikut ini:
Register-PackageSource -Trusted -ProviderName 'PowerShellGet' -Name 'Posh Test Gallery' -Location https://www.poshtestgallery.com/api/v2/
Lalu tambahkan module AzureAD dari gallery tersebut:
Install-Module AzureAD.Standard.Preview
Lali import module yang telah diinstall tersebut:
Import-Module AzureAD.Standard.Preview
Setelah itu jalankan perintah Connect-AzureAD lagi yang akan meminta kita membuka link dan mengisikan kode yang digenerate seperti di bawah ini:
PS /home/godril> Connect-AzureAD WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code SMXA7N6DA to authenticate.
Buka tautan ke https://microsoft.com/devicelogin lalu isikan kode SMXA7N6DA di atas:

Klik Next dan PowerShell akan otomatis login ke AzureAD.