-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for #16
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using namespace System.Management.Automation | ||
using namespace System.Management.Automation.Language | ||
using namespace System.Diagnostics.CodeAnalysis | ||
|
||
# Version: 0.1.0 | ||
|
||
# -------------------------------------------------------------------- | ||
# Current User, All Hosts Powershell Core v7 $PROFILE | ||
# Path: $Home\Documents\PowerShell\Profile.ps1 | ||
# -------------------------------------------------------------------- | ||
|
||
<# | ||
.SYNOPSIS | ||
Current User, All Hosts PowerShell `$PROFILE`: `Profile.ps1` | ||
.DESCRIPTION | ||
This script is executed when a new PowerShell session is created for the current user, on any host. | ||
.PARAMETER Vanilla | ||
Runs a "vanilla" session, without any configurations, variables, customizations, modules or scripts pre-loaded. | ||
.PARAMETER NoImports | ||
Skips importing modules and scripts. | ||
.NOTES | ||
Author: Jimmy Briggs <jimmy.briggs@jimbrig.com> | ||
#> | ||
#Requires -Version 7 | ||
[SuppressMessageAttribute('PSAvoidAssignmentToAutomaticVariable', '', Justification = 'PS7 Polyfill')] | ||
[SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Profile Script')] | ||
Param( | ||
[Parameter()] | ||
[Switch]$Vanilla, | ||
|
||
[Parameter()] | ||
[Switch]$NoImports | ||
) | ||
|
||
# -------------------------------------------------------------------- | ||
# Profile Variables | ||
# -------------------------------------------------------------------- | ||
|
||
# Profile Paths | ||
$ProfileRootPath = Split-Path -Path $PROFILE -Parent | ||
$ProfileSourcePath = Join-Path -Path $ProfileRootPath -ChildPath 'Profile' | ||
|
||
# System Information | ||
if ($PSEdition -eq 'Desktop') { | ||
$isWindows = $true | ||
$isLinux = $false | ||
$isMacOS = $false | ||
} | ||
|
||
# -------------------------------------------------------------------- | ||
# Profile Environment | ||
# -------------------------------------------------------------------- | ||
|
||
# Set editor to VSCode | ||
if (Get-Command code -Type Application -ErrorAction SilentlyContinue) { | ||
$ENV:EDITOR = 'code' | ||
} | ||
|
||
if ($Host.Name -eq 'ConsoleHost') { | ||
Write-Verbose "Detected Host: 'ConsoleHost'. Loading 'PSReadLine' Setup..." | ||
. "$ProfileSourcePath/Profile.PSReadLine.ps1" | ||
} | ||
|
||
. "$ProfileSourcePath/Profile.Shorthands.ps1" | ||
. "$ProfileSourcePath/Profile.Helpers.ps1" | ||
. "$ProfileSourcePath/Profile.Integrations.ps1" | ||
. "$ProfileSourcePath/Profile.Modules.ps1" |