If you are working with Azure Stack, you'll be pleasantly surprised that its PowerShell is the same PowerShell as what is used in Azure. Except not really. Okay, maybe sorta. Yes, it is the same, but there are additional commands that become available (duh) and some commands stop being available (also duh) depending on if you are talking to AS or just Azure.
There's a 369 step process to get up and going on Azure Stack PowerShell. I'm certain it will get better, but for today, I want to focus on getting Azure Stack PowerShell going the 2nd time - not just the first. This will hopefully save some WTF moments for you.
Note: this content is current as of 8/15/17 and may be inaccurate as of tomorrow. Azure moves at a pretty good clip these days. It also assumes you've done the initial setup and configuration of Azure Stack PowerShell, located here.
I'm also going to assume that we're playing the role of Azure Stack Administrator, cause well, why be a regular user when you can be an administrator.
- Open PowerShell
Add-AzureRMEnvironment -Name "AzureStackAdmin" -ArmEndpoint "https://adminmanagement.local.azurestack.external"
Login-AzureRMAccount -EnvironmentName "AzureStackAdmin"
- You should be prompted for AAD Auth. If you're using ADFS, well, look elsewhere.
That's literally it, you're going. All the other 'stuff' is extra helper classes and other scenarios that are useful if you need them, but wading through all that each time was annoying me, so, there you go.