-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMicrosoft.PowerShell_Profile.ps1
More file actions
33 lines (28 loc) · 1.24 KB
/
Microsoft.PowerShell_Profile.ps1
File metadata and controls
33 lines (28 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#requires -modules oh-my-posh
Set-Theme agnoster
# Powershell Community Extensions
Import-Module Pscx
#PSReadline Stuff
Set-PSReadlineOption -TokenKind Command -ForeGroundColor Cyan
Set-PSReadlineOption -EditMode EMACS
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadlineKeyHandler -Key CTRL+V -Function Paste
Set-PSReadlineKeyHandler -Key CTRL+RightArrow -Function ForwardWord
Set-PSReadlineKeyHandler -Key CTRL+LeftArrow -Function BackwardWord
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
$OnlineTest = Read-Host -Prompt "Do you want the O365 cmdlets?"
If($OnlineTest -eq "y") {
$Creds = Get-Credential -Message "Enter your O365 credentials"
$session = New-PSSession -ConfigurationName Microsoft.Exchange `
-ConnectionUri https://outlook.office365.com/powershell-liveid/ `
-Credential $Creds `
-Authentication Basic `
-AllowRedirection
Import-PSSession $session
}
Write-Output "Powershell profile loaded!"