-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMicrosoft.PowerShell_profile.ps1
54 lines (44 loc) · 1.66 KB
/
Microsoft.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
46
47
48
49
50
51
52
53
54
Set-StrictMode -Version 3.0
$ErrorActionPreference = 'Stop'
$script:profileDir = Join-Path $PSScriptRoot Profile
. "$profileDir/Common.ps1"
if ($IsWindows -and $null -eq $env:HOME -and $null -ne $env:USERPROFILE) {
$env:HOME = $env:USERPROFILE
}
. "$profileDir/Functions.ps1"
Sync-Path
if ($IsWindows) {
. "$PSScriptRoot/Run-Setup.ps1"
}
. "$profileDir/SetViMode.ps1" # always set vi mode before loading modules because of keybindings conflict with PSFzf
. "$profileDir/ImportModules.ps1"
$kubeConfigHome = Join-Path $env:HOME '.kube'
if (Test-Path $kubeConfigHome) {
& {
$kubeConfig = ''
$env:KUBECONFIG = Get-ChildItem $kubeConfigHome -File | Where-Object { $_.Name -ne 'kubectx' -and ($_.Name -ne 'kubens') } | ForEach-Object {} { $kubeConfig += "$($_.FullName)$([System.IO.Path]::PathSeparator)" } { $kubeConfig }
}
}
Remove-Variable kubeConfigHome
if ((Get-Command bat -CommandType Application -ErrorAction Ignore) -and (Get-Command less -CommandType Application -ErrorAction Ignore)) {
$env:BAT_PAGER = "less -RF"
}
if ((Get-Module PSReadLine) -and ([bool]($(Get-PSReadLineOption).PSobject.Properties.name -match "PredictionSource"))) {
if ($(Get-PSReadLineOption).PredictionSource -eq 'None') {
Set-PSReadLineOption -PredictionSource History
}
}
$env:DOCKER_BUILDKIT = 1
. "$profileDir/Completions.ps1"
. "$profileDir/CreateAliases.ps1"
if ($IsWindows) {
. "$profileDir/profile.windows.ps1"
}
. "$profileDir/Prompt.ps1"
. "$profileDir/Zoxide.ps1"
# cleanup:
Set-StrictMode -Off
Remove-Variable localModulesDirectory
Remove-Variable localAdditionalModulesDirectory
Remove-Variable profileDir
$ErrorActionPreference = 'Continue'