forked from ruudmens/LazyAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PowerShell Profile.ps1
45 lines (33 loc) · 1.22 KB
/
PowerShell Profile.ps1
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
34
35
36
37
38
39
40
41
42
43
44
45
# Style default PowerShell Console
$shell = $Host.UI.RawUI
$shell.WindowTitle= "PS"
$shell.BackgroundColor = "Black"
$shell.ForegroundColor = "White"
# Load custom theme for Windows Terminal
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme LazyAdmin
# Set Default location
Set-Location D:\SysAdmin\scripts
# Set StrictMode to version 2
Set-StrictMode -Version 2
# Bind tab key to full autocomplete
Set-PSReadlineKeyHandler -Key Tab -Function Complete
# Create easy to remember short hand for editing this file
Function Edit-Profile {ise $profile}
# Load scripts from the following locations
$env:Path += ";D:\SysAdmin\scripts\Connectors"
$env:Path += ";D:\SysAdmin\scripts\Office365"
# Set default variables
$adminUPN = "[email protected]"
$sharepointAdminUrl = "https://lazydev-admin.sharepoint.com"
# Create aliases for frequently used commands
Set-Alias im Import-Module
Set-Alias tn Test-NetConnection
# Lazy way to use scripts as module
Set-Alias ConnectTo-SharePointAdmin ConnectTo-SharePointAdmin.ps1
Set-Alias ConnectTo-EXO ConnectTo-EXO.ps1
Set-Alias Get-MFAStatus MFAStatus.ps1
Set-Alias Get-MailboxSizeReport MailboxSizeReport.ps1
Set-Alias Get-OneDriveSizeReport OneDriveSizeReport.ps1
#Clear-host