Please see the article on how to install powershell on a azure virtual machine as a prerequisite to this article.
This short article will demonstrate how to connect to your azure subscription from powershell.
1. Type command Get-AzurePublshSettingsFile. This will retrieve the azure subscription with which you are currently logged in.
2. Sign In with your azure credentials
8. A settings file will download to the virtual machine.
9. Type command Import-AzurePublishSettingsFile to import the file that was just download
10. On the next input provide the full path to settings file that was downloaded.
11.Type command Get-AzureSubscription
After this command you will be connected to your azure subscription via powershell.