Q: How can I manage mysubscription using PowerShell?
A: Several options exist for integrating Office 365 with PowerShell. The easiest approach is to create a PowerShell session to the Office 365 service, which then has all the required PowerShell modules available without you needing to install anything locally. The following PowerShell code will trigger an authentication window for your Office 365 credentials, establishing a session to Office 365 where you can run your commands.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
#Run you commands here, for example
Get-accepteddomain | ft DomainName, DomainType, Default, PendingRemoval -AutoSize
#Close the session