$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
This file contains hidden or 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
$sw = [Diagnostics.Stopwatch]::StartNew() | |
Write-Host "Updating path..." -foregroundColor DarkGreen | |
if(!($env:path).contains((Split-Path $PROFILE))) { | |
$env:path += ";" + (Split-Path $PROFILE) | |
} | |
if(!($env:path).contains('D:\dNx\dnx-util;')) { | |
$env:path += ";" + 'D:\dNx\dnx-util;' | |
} | |
if(!($env:path).contains('D:\dNx\dnx-util\test;')) { | |
$env:path += ";" + 'D:\dNx\dnx-util\test;' |
This file contains hidden or 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
#requires -version 5.0 | |
#requires -module PSReadline | |
Function Optimize-PSReadLineHistory { | |
<# | |
.SYNOPSIS | |
Optimize the PSReadline history file | |
.DESCRIPTION | |
The PSReadline module can maintain a persistent command-line history. However, there are no provisions for managing the file. When the file gets very large, performance starting PowerShell can be affected. This command will trim the history file to a specified length as well as removing any duplicate entries. | |
.PARAMETER MaximumLineCount |
This file contains hidden or 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
#Requires -Version 7 | |
# Version 1.2.13 | |
# check if newer version | |
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e" | |
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version') | |
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)" | |
if ([System.IO.File]::Exists($latestVersionFile)) { |
This file contains hidden or 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
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
if ($host.Name -eq 'ConsoleHost') | |
{ | |
Import-Module PSReadLine | |
} | |
#Import-Module PSColors | |
#Import-Module posh-git | |
Import-Module -Name Terminal-Icons |
This file contains hidden or 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
function SetupProfile() | |
{ | |
Import-Module posh-git | |
$GitPromptSettings.BranchColor.ForegroundColor = 'Black' | |
$GitPromptSettings.BeforeStatus.ForegroundColor = 'Black' | |
$GitPromptSettings.AfterStatus.ForegroundColor = 'Black' | |
$GitPromptSettings.DelimStatus.ForegroundColor = 'Black' | |
$GitPromptSettings.BranchBehindAndAheadStatusSymbol.ForegroundColor = 'DarkRed' | |
oh-my-posh.exe init pwsh --config "~/.oh-my-posh.omp.json" | Invoke-Expression |
This file contains hidden or 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
function Run-Step([string] $Description, [ScriptBlock]$script) | |
{ | |
Write-Host -NoNewline "Loading " $Description.PadRight(20) | |
& $script | |
Write-Host "`u{2705}" # checkmark emoji | |
} | |
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding | |
$stopwatch = [system.diagnostics.stopwatch]::StartNew() |