Hi I want t run PowerShell on my Ubuntu machine and also add support for Azure. Because soon I will try to set up some federation in Azure.
Below is from Microsoft
https://docs.microsoft.com/en-us/microsoft-365/enterprise/connect-to-microsoft-365-powershell?view=o365-worldwide
It is in Swedish but It says that Ubuntu 20.04 is not supported. I will be supported in the 7.1 release. The screenshot is from 2020-10-20

Star a terminal and run the command:
snap install powershell --classic

The run powershell
pwsh

Then we want to add support for AzureAD with this command:
Then register this gallery
Register-PackageSource -Trusted -ProviderName 'PowerShellGet' -Name 'Posh Test Gallery' -Location https://www.poshtestgallery.com/api/v2/

Then we add the AzureAD module
Install-Module AzureAD.Standard.Preview

Then we import the module
Import-Module AzureAD.Standard.Preview

Then we connect to AureAD
Connect-AzureAD

Then we open a browser and surf to https://microsoft.com/devicelogin and put in the code that you receive from above command.

Choose the account that you want to login to

You are in! You think!
But it will not work with standard PowerShell.
I just wanted to see how many read this far. Sure get pissed, but if I did the mistake you can handle it!
The only think you need to do different is run powershell preview instead. Thats all, I promise!
sudo snap install powershell-preview --classic

Now yo can run Azure commands like
Get-AzureADApplication

I hope I help someone out the with Ubuntu that want to work with Powershell!
Have a nice day!
Thank you very much!! I was able to use powershell thanks to you and this post.
Have a great life.
LikeLike