Skip to content

Instantly share code, notes, and snippets.

@ksmutny
ksmutny / Microsoft.PowerShell_profile.ps1
Last active November 25, 2023 13:45
PowerShell profile. Place into %USERPROFILE%\Documents\PowerShell
oh-my-posh.exe --init --shell pwsh --config "D:\OneDrive\Documents\Settings\Windows Terminal\oh-my-posh\kaja.omp.json" | Invoke-Expression
Import-Module -Name Terminal-Icons
Import-Module -Name CompletionPredictor
# dotnet CLI parameter completion
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
@ksmutny
ksmutny / settings.json
Created November 25, 2023 09:48
Windows Terminal settings. Place into %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@ksmutny
ksmutny / hide-dot-folders.ps1
Created November 25, 2023 09:03
Sets hidden attribute for all .dot folders. Can be configured to hide additional folders.
$currentDirectory = Get-Location
$namedDirectories = 'Contacts', 'Favorites', 'Links', 'Saved Games', 'Searches'
$directoriesToHide = Get-ChildItem -Path $currentDirectory -Directory |
Where-Object { $_.Name.StartsWith('.') -or $namedDirectories -contains $_.Name }
foreach ($dir in $directoriesToHide) {
$attributes = [System.IO.FileAttributes]::Hidden
@ksmutny
ksmutny / oh-my-posh.json
Last active February 17, 2024 08:27
My custom Oh My Posh theme.
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"palette": {
"white": "#ffffff",
"teal": "#047e84",
"plum": "#9a348e",
"dotnet": "#684396",
"rust": "#f05320",