Skip to content

Commit

Permalink
Display the connected account in the title
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
nikkelly committed Aug 22, 2021
1 parent 3704a6a commit 9776a15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions microsoftServicesProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ else {
Write-Host "Prompting for login"
$microsoftUser = Read-Host -Prompt "Enter Username"
$inputPassword = Read-Host -Prompt "Enter password" -AsSecureString
$host.ui.RawUI.WindowTitle = 'Connected Account: '+$microsoftUser
# save credentials
Write-Host "`n`nWould you like to save them for later?" -ForegroundColor Yellow -NoNewLine
Write-Host " (Y / N)" -ForegroundColor White -NoNewLine
Expand Down Expand Up @@ -45,6 +46,7 @@ $microsoftUser = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.Int
$global:securePwd = ConvertTo-SecureString $microsoftPassword
$global:creds = New-Object System.Management.Automation.PSCredential -ArgumentList $microsoftUser, $securePwd
$domain = $microsoftUser.split('@')[1]
$host.ui.RawUI.WindowTitle = 'Connected: '+$microsoftUser

# display found account
Write-Host "Account " -NoNewLine
Expand Down

0 comments on commit 9776a15

Please sign in to comment.