Showing items from Powershell

How to Use CTRL+D To Close A PowerShell Window

If you’re familiar with using CTRL+D to exit out of your shell and want the same functionality for your PowerShell, here’s how to do it.

Open your PowerShell profile (Documents\PowerShell\Microsoft.PowerShell_profile.ps1):

notepad $PROFILE

and add this line:

Set-PSReadLineKeyHandler -Key Ctrl+d -Function DeleteCharOrExit

That’s it. Now reload your profile (or open a new terminal):

Continue Reading

Setting Up SMTP Forwarding Via PowerShell on Office 365

These are the commands needed to set up SMTP forwarding for an email address in Office 365 using PowerShell.

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Set-Mailbox -ForwardingSmtpAddress "" -Identity ""
Remove-PSSession $Session

Continue Reading