Skip to content

Instantly share code, notes, and snippets.

View oleksbabieiev's full-sized avatar

Oleksandr Babieiev oleksbabieiev

View GitHub Profile
@phil-scott-78
phil-scott-78 / Microsoft.PowerShell_profile.ps1
Last active November 19, 2022 18:19
Powershell Profile
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()
@kapsiR
kapsiR / PowerShell_profile.ps1
Last active April 24, 2024 13:12
PowerShell Profile
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
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
@SteveL-MSFT
SteveL-MSFT / profile.ps1
Last active May 27, 2024 14:02
PowerShell Prompt
#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)) {
@jdhitsolutions
jdhitsolutions / Optimize-PSReadLineHistory
Created November 2, 2017 13:35
A PowerShell command to trim the command history file used by PSReadline
#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.
@dprice
dprice / Microsoft.PowerShell_profile.ps1
Last active August 15, 2023 20:58
PowerShell Profile #tag PowerShell
$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;'
@davidfowl
davidfowl / dotnetlayout.md
Last active July 22, 2024 09:49
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/