title: Does Connect-MsolService -Credential no longer work?
body: <p>I'm attempting to create the ability to connect to my o365 instance through the use of connect-msolservice. Im running into the issue that no matter what I try Im unable to use -Credential to feed it a username and password and avoid a prompt. This is a massive issue as there is literally no point in attempting to automate a process unless it automates the connection too.</p>
  <p>Currently what I'm trying to use:</p>
  <pre><code>$AdminName = &quot;admin email account&quot;
  $Pass = Get-Content &quot;C:\test.txt&quot; | ConvertTo-SecureString
  $Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $AdminName, $Pass
  
  Import-Module MSOnline
  Connect-MsolService -Credential $cred
  $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication Basic -AllowRedirection
  Import-PSSession $Session
  </code></pre>
  <p>Everywhere I check online tells me that this should be possible and for the life of me I cant find anything obvious that I'm doing incorrectly, albeit, all the posts and info I do find are about a year old. This leads me to the question, is this simply no longer supported? If not and hopefully this is the case, what am I doing incorrectly?</p>