{"id":20073811,"url":"https://github.com/jimbrig/powershell","last_synced_at":"2025-05-05T21:31:06.339Z","repository":{"id":40487787,"uuid":"387677680","full_name":"jimbrig/PowerShell","owner":"jimbrig","description":"PowerShell Core Profile Directory","archived":false,"fork":false,"pushed_at":"2024-01-18T00:32:18.000Z","size":539,"stargazers_count":16,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-23T00:34:45.973Z","etag":null,"topics":["configuration","customization","developer-tools","dotfiles","powershell","powershell-module","powershell-script","profile","setup-development-environment"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimbrig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-20T05:03:22.000Z","updated_at":"2024-08-13T07:06:27.045Z","dependencies_parsed_at":"2023-11-18T18:26:10.342Z","dependency_job_id":"3b53666f-e6a3-4026-af07-d6f005774c78","html_url":"https://github.com/jimbrig/PowerShell","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbrig%2FPowerShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbrig%2FPowerShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbrig%2FPowerShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbrig%2FPowerShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimbrig","download_url":"https://codeload.github.com/jimbrig/PowerShell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252580000,"owners_count":21771248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","customization","developer-tools","dotfiles","powershell","powershell-module","powershell-script","profile","setup-development-environment"],"created_at":"2024-11-13T14:48:18.904Z","updated_at":"2025-05-05T21:31:05.642Z","avatar_url":"https://github.com/jimbrig.png","language":"PowerShell","readme":"# PowerShell\n\nMy customized powershell (core) profile directory `~/Documents/PowerShell` (or `~/Documents/OneDrive/PowerShell`).\n\nSee the [Changelog](CHANGELOG.md) for details on this repository's development over time.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Overview](#overview)\n- [Core `$PROFILE`](#core-profile)\n- [The Profile Directory](#the-profile-directory)\n  - [Options](#options)\n  - [Prompt](#prompt)\n  - [Functions](#functions)\n  - [Aliases](#aliases)\n  - [Shell Completions](#shell-completions)\n  - [Modules](#modules)\n- [Scripts](#scripts)\n- [Functions](#functions-1)\n  - [Appendix: Modules](#appendix-modules)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Overview\n\nIn this repository there are the following profile files:[^1]\n\n- [profile.ps1](profile.ps1) - *CurrentUserAllHosts* Profile\n- [Microsoft.PowerShell_profile.ps1](Microsoft.PowerShell_profile.ps1) - *CurrentUserCurrentHost* Profile - The Default `$PROFILE`\n- [Microsoft.VSCode_profile.ps1](Microsoft.VSCode_profile.ps1) - VSCode Specific Host Profile\n\nNotes:\n\n- For [Microsoft.PowerShell_profile.ps1](Microsoft.PowerShell_profile.ps1) and [Microsoft.VSCode_profile.ps1](Microsoft.VSCode_profile.ps1):\n- I currently do not separate User specific configs from system wide/VSCode specific configs, so nothing here; included for reference.\n\n## Core `$PROFILE`\n\nFor [profile.ps1](profile.ps1) (main `profile`):\n\nSimply dot sources each top-level `*.ps1` file from the [Profile](Profile) directory:\n\n- [aliases.ps1](Profile/aliases.ps1)\n- [completion.ps1](Profile/completion.ps1)\n- [functions.ps1](Profile/functions.ps1)\n- [modules.ps1](Profile/modules.ps1)\n- [options.ps1](Profile/options.ps1)\n- [prompt.ps1](Profile/prompt.ps1)\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./profile.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./profile.ps1 --\u003e\n```ps1\n#Requires -Version 7\n\n# Version: 0.1.0\n\n# ----------------------------------------------------\n# Current User, All Hosts Powershell Core v7 $PROFILE:\n# ----------------------------------------------------\n\n$psfiles = Join-Path (Split-Path -Parent $profile) \"Profile\" | Get-ChildItem -Filter \"*.ps1\"\nForEach ($file in $psfiles) { . $file }\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n## The [Profile](Profile) Directory\n\nAll features of the `$PROFILE` come from the [Profile](Profile) directory:\n\n```powershell\n➜ ~\\OneDrive\\Documents\\PowerShell :: git(main)                        01:39:05  \n➜ tree /F /A Profile\nFolder PATH listing\nVolume serial number is 4879-37CA\nC:\\USERS\\JIMMY\\ONEDRIVE\\DOCUMENTS\\POWERSHELL\\PROFILE\n|   aliases.ps1\n|   completion.ps1\n|   functions.ps1\n|   modules.ps1\n|   options.ps1\n|   prompt.ps1\n|   \n+---aliases\n|       aliases-export.ps1\n|       \n+---completions\n|       aws.ps1\n|       choco.ps1\n|       docker.ps1\n|       dotnet.ps1\n|       gh-cli.ps1\n|       git-cliff.ps1\n|       s-search.ps1\n|       scoop.ps1\n|       spotify.ps1\n|       winget.ps1\n|       yq.ps1\n|       \n\\---functions\n        Get-AdminRights.ps1\n        Get-NetAccelerators.ps1\n        Get-NetFramework.ps1\n        Get-RandomAbout.ps1\n        Get-RandomHelp.ps1\n        Launch-AzurePortal.ps1\n        Module-Helpers.ps1\n        System-Functions.ps1\n        Test-WiFi.ps1\n```\n\n### Options\n\nSee *[options.ps1](Profile/options.ps1)*.\n\n- Trust `PSGallery`\n- Setup some `$PSDefaultParameterValues`\n- Set some PSReadLine Handlers\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./Profile/options.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./Profile/options.ps1 --\u003e\n```ps1\n# Trust PSGallery\n$galleryinfo = Get-PSRepository | Where-Object { $_.Name -eq \"PSGallery\" }\nif (-not($galleryinfo.InstallationPolicy.Equals(\"Trusted\"))) { Set-PSRepository -Name PSGallery -InstallationPolicy Trusted }\n\n# Default Parameters\n$PSDefaultParameterValues = @{\n\t\"Update-Module:Confirm\"     = $False;\n\t\"Update-Module:Force\"       = $True;\n\t\"Update-Module:Scope\"       = \"CurrentUser\";\n\t\"Update-Module:ErrorAction\" = \"SilentlyContinue\";\n\t\"Update-Help:Force\"         = $True;\n\t\"Update-Help:ErrorAction\"   = \"SilentlyContinue\";\n}\n\n# Set PSReadLineOptions's (Beta Version Required):\nSet-PSReadLineOption -PredictionSource History -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\nSet-PSReadLineOption -PredictionViewStyle ListView -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\nSet-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward\nSet-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward\nSet-PSReadLineOption -EditMode Windows\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n### Prompt\n\n- Set `prompt` theme via `oh-my-posh`\n- Output useful startup information\n\nFrom *[prompt.ps1](Profile/prompt.ps1):*\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./Profile/prompt.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./Profile/prompt.ps1 --\u003e\n```ps1\n# Prompt\nIf (Get-Command oh-my-posh -ErrorAction SilentlyContinue) {\n    oh-my-posh init pwsh --config $ENV:POSH_THEMES_PATH\\wopian.omp.json | Invoke-Expression\n}\n\n# Write Current Version and Execution Policy Details:\nWrite-Host \"PowerShell Version: $($psversiontable.psversion) - ExecutionPolicy: $(Get-ExecutionPolicy)\" -ForegroundColor yellow\n\n# ZLocation must be after all prompt changes:\nImport-Module ZLocation\nWrite-Host -Foreground Green \"`n[ZLocation] knows about $((Get-ZLocation).Keys.Count) locations.`n\"\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n### Functions\n\nMy suite of custom functions to be loaded for every PowerShell session:\n  - Search functions via [zquestz/s](https://github.com/zquestz/s)\n  - Google Calendar functions via [gcalcli](https://github.com/insanum/gcalcli)\n  - Directory listing functions for `lsd`\n  - System Utility Functions\n  - Symlinking Functions\n  - Network Utilities\n  - Programs\n  - PowerShell helpers\n  - Remoting\n  - Chocolatey\n  - R and RStudio\n  - GitKraken\n\n- See [functions.ps1](Profile/functions.ps1):\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./Profile/functions.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./Profile/functions.ps1 --\u003e\n```ps1\n# ----------\n# Launchers\n# ----------\n\nFunction Open-Todoist { Start-Process -PassThru 'C:\\Users\\jimmy\\AppData\\Local\\Programs\\todoist\\Todoist.exe' }\n\nFunction Open-GitHub { Start-Process -PassThru 'https://github.com/' }\n\nFunction Open-Docker { Start-Process -PassThru 'C:\\Program Files\\Docker\\Docker\\frontend\\Docker Desktop.exe' }\n\nFunction Open-RProject { Rscript -e 'jimstools::open_project()' }\n\n# ---------------------------------\n# PowerShell Core Profile Functions\n# ---------------------------------\n\nFunction Remove-OldModules {\n\n  Write-Host 'this will remove all old versions of installed modules'\n  Write-Host 'be sure to run this as an admin' -ForegroundColor yellow\n  Write-Host '(You can update all your Azure RM modules with update-module Azurerm -force)'\n\n  $mods = Get-InstalledModule\n\n  foreach ($mod in $mods) {\n    Write-Host \"Checking $($mod.name)\"\n    $latest = Get-InstalledModule $mod.name\n    $specificmods = Get-InstalledModule $mod.name -AllVersions\n    Write-Host \"$($specificmods.count) versions of this module found [ $($mod.name) ]\"\n  \n    foreach ($sm in $specificmods) {\n      if ($sm.version -ne $latest.version) {\n        Write-Host \"uninstalling $($sm.name) - $($sm.version) [latest is $($latest.version)]\"\n        $sm | Uninstall-Module -Force\n        Write-Host \"done uninstalling $($sm.name) - $($sm.version)\"\n        Write-Host '    --------'\n      }\n\t\n    }\n    Write-Host '------------------------'\n  }\n  Write-Host 'done'\n\n}\n\nFunction Update-ProfileModules {\n\n  $modpath = ($env:PSModulePath -split \";\")[0]\n  $ymlpath = \"$modpath\\modules.yml\"\n  $mods = (Get-ChildItem $modpath -Directory).Name\n  ConvertTo-Yaml -Data $mods -OutFile $ymlpath -Force\n\n  # Set-Location \"$HOME\\Documents\"\n  # git pull\n  # git add PowerShell/Modules/**\n  # git commit -m \"config: Updated modules configurations\"\n  # git-cliff -o \"$HOME\\Documents\\CHANGELOG.md\"\n  # git add CHANGELOG.md\n  # git commit -m \"doc: update CHANGELOG.md for added modules\"\n  # git push\n\n}\n\n# ----------------------\n# System Utilities\n# ----------------------\n\n# Troubleshooters\n\n# Hardware Troubleshooter (unavailable in settings)\n${function:Invoke-HardwareDiagnostic} = { \u0026 msdt.exe -id DeviceDiagnostic }\n${function:Invoke-NetworkDiagnostic} = { \u0026 msdt.exe -id NetworkDiagnosticsNetworkAdapter }\n${function:Invoke-SearchDiagnostic} = { \u0026 msdt.exe -id SearchDiagnostic }\n${function:Invoke-WindowsUpdateDiagnostic} = { \u0026 msdt.exe -id WindowsUpdateDiagnostic }\n${function:Invoke-MaintenanceDiagnostic} = { \u0026 msdt.exe -id MaintenanceDiagnostic }\n\n# Check Disk\n${function:Check-Disk} = { \u0026 chkdsk C: /f /r /x }\n\n# Update Environment\n${function:Update-Environment} = {\n  $env:Path = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\") + \";\" + [System.Environment]::GetEnvironmentVariable(\"Path\", \"User\")\n  Write-Host -ForegroundColor Green \"Sucessfully Refreshed Environment Variables For powershell.exe\"\n}\n\n# Clean System\n${function:Clean-System} = {\n  Write-Host -Message 'Emptying Recycle Bin' -ForegroundColor Yellow\n  (New-Object -ComObject Shell.Application).Namespace(0xA).items() | ForEach-Object { Remove-Item $_.path -Recurse -Confirm:$false }\n  Write-Host 'Removing Windows %TEMP% files' -ForegroundColor Yellow\n  Remove-Item c:\\Windows\\Temp\\* -Recurse -Force -ErrorAction SilentlyContinue\n  Write-Host 'Removing User %TEMP% files' -ForegroundColor Yellow\n  Remove-Item “C:\\Users\\*\\Appdata\\Local\\Temp\\*” -Recurse -Force -ErrorAction SilentlyContinue\n  Write-Host 'Removing Custome %TEMP% files (C:/Temp and C:/tmp)' -ForegroundColor Yellow\n  Remove-Item c:\\Temp\\* -Recurse -Force -ErrorAction SilentlyContinue\n  Remove-Item c:\\Tmp\\* -Recurse -Force -ErrorAction SilentlyContinue\n  Write-Host 'Launchin cleanmgr' -ForegroundColor Yellow\n  cleanmgr /sagerun:1 | Out-Null\n  Write-Host '✔️ Done.' -ForegroundColor Green\n}\n\n# New File\n${function:New-File} = { New-Item -Path $args -ItemType File -Force }\n\n# New Directory\n${function:New-Dir} = { New-Item -Path $args -ItemType Directory -Force }\n\n# Net Directory and cd into\n${function:CreateAndSet-Directory} = {\n  New-Item -Path $args -ItemType Directory -Force\n  Set-Location -Path \"$args\"\n}\n\n# Create Symlink\nFunction New-Link ($target, $link) {\n  New-Item -Path $link -ItemType SymbolicLink -Value $target\n}\n\n# Take Ownership\nFunction Invoke-TakeOwnership ( $path ) {\n  if ((Get-Item $path) -is [System.IO.DirectoryInfo]) {\n    sudo TAKEOWN /F $path /R /D Y\n  } else {\n    sudo TAKEOWN /F $path\n  }\n}\n\n# Force Delete\nFunction Invoke-ForceDelete ( $path ) {\n  Take-Ownership $path\n  sudo remove-item -path $path -Force -Recurse -ErrorAction SilentlyContinue\n  if (!(Test-Path $path)) {\n    Write-Host \"✔️ Successfully Removed $path\" -ForegroundColor Green\n  } else {\n    Write-Host \"❌ Failed to Remove $path\" -ForegroundColor Red\n  }\n}\n\n# ------------------\n# Network Utilities\n# ------------------\n\n${function:Reset-Network} = {\n  Write-Host \"Resetting Windows Sockets..\" -ForegroundColor Yellow\n  netsh winsock reset\n  Write-Host \"Resetting Internal IP Addresses..\" -ForegroundColor Yellow\n  netsh int ip reset all\n  Write-Host \"Resetting Windows HTTP Proxy..\" -ForegroundColor Yellow\n  netsh winhttp reset proxy\n  Write-Host \"Flushing DNS..\" -ForegroundColor Yellow\n  ipconfig /flushdns\n  Write-Host \"✔️ Done.\" -ForegroundColor Green\n  $restart = Read-Host \"To apply changes a restart is required, restart now? (y/n)\"\n  If ($restart -eq \"y\") { Restart-Computer }\n}\n\n${function:Get-IP} = {\n  ((ipconfig | findstr [0-9].\\.)[0]).Split()[-1]\n}\n\n# Get Public IP\n${function:Get-PublicIP} = {\n  $ip = Invoke-RestMethod -Uri 'https://api.ipify.org?format=json'\n  \"My public IP address is: $($ip.ip)\"\n}\n\n# --------------------------\n# PowerShell Functions\n# --------------------------\n\n# Edit `profile.ps1`\n${function:Edit-Profile} = { code $PROFILE.CurrentUserAllHosts }\n\n# Edit profile_functions.ps1\n${function:Edit-Functions} = {\n  $prodir = Split-Path -Path $PROFILE -Parent\n  $funcpath = \"$prodir\\Profile\\functions.ps1\"\n  code $funcpath\n}\n\n# Edit profile_aliases.ps1\n${function:Edit-Aliases} = {\n  $prodir = Split-Path -Path $PROFILE -Parent\n  $funcpath = \"$prodir\\Profile\\aliases.ps1\"\n  code $funcpath\n}\n\n# Edit profile_completion.ps1\n${function:Edit-Completion} = {\n  $prodir = Split-Path -Path $PROFILE -Parent\n  $funcpath = \"$prodir\\Profile\\completion.ps1\"\n  code $funcpath\n}\n\n# Open Profile Directory in VSCode:\n${function:Edit-ProfileDirectory} = {\n  $prodir = Split-Path -Path $PROFILE -Parent\n  code $prodir\n}\n\n${function:Get-HistPath} = { (Get-PSReadlineoption).HistorySavePath }\n\n# ----------\n# Secrets\n# ----------\n\nFunction Get-MySecret($name) {\n  $secrets = (Get-SecretInfo).Name\n  If (!($secrets -contains $name)) { throw \"No secret named $name found in vault.\" }\n  Get-Secret -Name $name -AsPlainText\n}\n\nFunction Get-GitCryptStatus {\n  git-crypt status -e\n}\n\nFunction Invoke-GitCryptStatus {\n  git-crypt status -f\n}\n\n# ------------------\n# Remoting\n# ------------------\n\n# Invoke Remote Script - Example: Invoke-RemoteScript \u003curl\u003e\nFunction Invoke-RemoteScript {\n  [CmdletBinding()]\n  param(\n    [Parameter(Position = 0)]\n    [string]$address,\n    [Parameter(ValueFromRemainingArguments = $true)]\n    $remainingArgs\n  )\n  Invoke-Expression \"\u0026 { $(Invoke-RestMethod $address) } $remainingArgs\"\n}\n\n# ------\n# Docker\n# ------\n\n# Docker\n${function:Start-Docker} = { Start-Process \"C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe\" }\n${function:Stop-Docker} = { foreach ($dock in (Get-Process *docker*).ProcessName) { sudo stop-process -name $dock } }\n\n\n# Open RStudio in Current Repo\n${function:rstudio} = {\n  $curpath = (Get-Location).ProviderPath\n  $logf = \"$env:temp\\rstudiostart.log\"\n  $exepath = \"$env:programfiles\\RStudio\\bin\\rstudio.exe\"\n  Start-Process -FilePath $exepath -ArgumentList \"--path $curpath\" -RedirectStandardOutput $logf\n}\n\n# -----------\n# Chocolatey\n# -----------\n\n${function:chocopkgs} = { \u0026 choco list --local-only }\n${function:chococlean} = { \u0026 choco-cleaner }\n${function:chocoupgrade} = { \u0026 choco upgrade all -y }\n${function:chocobackup} = { \u0026 choco-package-list-backup }\n${function:chocosearch} = { \u0026 choco search $args }\n\n# ---------------\n# R and RStudio\n# ---------------\n\n${function:rvanilla} = { \u0026 \"C:\\Program Files\\R\\R-4.1.1\\bin\\R.exe\" --vanilla }\n${function:radianvanilla} = { \u0026 \"C:\\Python39\\Scripts\\radian.exe\" --vanilla }\n${function:openrproj} = { \u0026 C:\\bin\\openrproject.bat }\n${function:pakk} = { Rscript.exe \"C:\\bin\\pakk.R\" $args }\n\n# ---------\n# GitKraken\n# ---------\n\n# Open GitKraken in Current Repo\n${function:krak} = {\n  $curpath = (Get-Location).ProviderPath\n  If (!(Test-Path \"$curpath\\.git\")) { Write-Error \"Not a git repository. Run 'git init' or select a git tracked directory to open. Exiting..\"; return }\n  $logf = \"$env:temp\\krakstart.log\"\n  $newestExe = Resolve-Path \"$env:localappdata\\gitkraken\\app-*\\gitkraken.exe\"\n  If ($newestExe.Length -gt 1) { $newestExe = $newestExe[1] }\n  Start-Process -FilePath $newestExe -ArgumentList \"--path $curpath\" -RedirectStandardOutput $logf\n}\n\n# ---------------------\n# Search via `s-cli`\n# ---------------------\n\nIf (Get-Command s -ErrorAction SilentlyContinue) {\n\n  ${function:Search-GitHub} = { s -p github $args }\n  ${function:Search-GitHubPwsh} = { s -p ghpwsh $args }\n  ${function:Search-GitHubR} = { s -p ghr $args }\n  ${function:Search-MyRepos} = { s -p myrepos $args }\n\n}\n\n# --------\n# GCalCLI\n# --------\n\nIf (Get-Command gcalcli -ErrorAction SilentlyContinue) {\n  ${function:Get-Agenda} = { \u0026 gcalcli agenda }\n  ${function:Get-CalendarMonth} = { \u0026 gcalcli calm }\n  ${function:Get-CalendarWeek} = { \u0026 gcalcli calw }\n  ${function:New-CalendarEvent} = { \u0026 gcalcli add }\n  ${function:Remove-CalendarEvent} = { \u0026 gcalcli delete $args }\n}\n\n# -----\n# LSD\n# -----\n\nIf (Get-Command lsd -ErrorAction SilentlyContinue) {\n  ${function:lsa} = { \u0026 lsd -a }\n}\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n### Aliases\n\n- See [aliases.ps1](Profile/aliases.ps1): \n*(and the exported [aliases-export.ps1](Profile/aliases/aliases-export.ps1))*\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./Profile/aliases.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./Profile/aliases.ps1 --\u003e\n```ps1\n# -------------------------\n# PowerShell Aliases\n# -------------------------\n\nSet-Alias -Name pro -Value Edit-Profile\nSet-Alias -Name aliases -Value Get-Alias\nSet-Alias -Name refresh -Value refreshenv\nSet-Alias -Name touch -Value New-File\nSet-Alias -Name rproj -Value openrproj\nSet-Alias -Name chkdisk -Value Check-Disk\nSet-Alias -Name cdd -Value CreateAndSet-Directory\nSet-Alias -Name emptytrash -Value Clear-RecycleBin\nSet-Alias -Name checkdisk -Value Invoke-Checkdisk\nSet-Alias -Name sfc -Value Invoke-SFCScan\nSet-Alias -Name expl -Value explorer.exe\nSet-Alias -Name np -Value 'C:\\Program Files\\WindowsApps\\Microsoft.WindowsNotepad_11.2111.0.0_x64__8wekyb3d8bbwe\\Notepad\\Notepad.exe'\n\n# Set-Alias -Name files -Value 'C:\\Program Files\\WindowsApps\\49306atecsolution.FilesUWP_2.0.34.0_x64__et10x9a9vyk8t\\Files.exe'\n\n# Remove stupid 'touch' alias for 'set-filetime'\nRemove-Alias -Name touch\n\n# Ensure `R` is for launching an R Terminal:\nif (Get-Command R.exe -ErrorAction SilentlyContinue | Test-Path) {\n\tRemove-Item Alias:r -ErrorAction SilentlyContinue\n\t${function:r} = { R.exe @args }\n}\n\n# VSCode / VSCode Insiders\nIf (!(Get-Command code -ErrorAction SilentlyContinue)) {\n\tSet-Alias -Name code -Value code-insiders\n}\n\n# Ensure gpg points to correct program\n# Set-Alias -Name gpg -Value 'C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe'\n\n# Chocolatey\nIf (Get-Command choco -ErrorAction SilentlyContinue) {\n\tSet-Alias -Name cpkgs -Value chocopkgs\n\tSet-Alias -Name csearch -Value chocosearch\n\tSet-Alias -Name cup -Value chocoupgrade\n\n\tIf (Get-Command choco-cleaner -ErrorAction SilentlyContinue) {\n\t\tSet-Alias -Name cclean -Value chococlean\n\t}\n\tIf (Get-Command choco-package-list-backup -ErrorAction SilentlyContinue) {\n\t\tSet-Alias -Name cbackup -Value chocobackup\n\t}\n}\n\n# gcalcli\nIf (Get-Command gcalcli -ErrorAction SilentlyContinue) {\n\tSet-Alias -Name gcal -Value gcalcli\n\tSet-Alias -Name agenda -Value Get-Agenda\n\tSet-Alias -Name gcalm -Value Get-CalendarMonth\n\tSet-Alias -Name gcalw -Value Get-CalendarWeek\n\tSet-Alias -Name calm -Value Get-CalendarMonth\n\tSet-Alias -Name calw -Value Get-CalendarWeek\n\tSet-Alias -Name gcaladd -Value New-CalendarEvent\n\tSet-Alias -Name caladd -Value New-CalendarEvent\n}\n\n# git-crypt\nIf (Get-Command git-crypt -ErrorAction SilentlyContinue) {\n\tSet-Alias -Name gcrypts -Value Get-GitCryptStatus\n\tSet-Alias -Name gcrypt -Value git-crypt\n\tSet-Alias -Name gcryptf Invoke-GitCryptStatus\n}\n\n# If using code-insiders\nIf (Get-Command code-insiders -ErrorAction SilentlyContinue) {\n\tSet-Alias -Name codee -Value code-insiders\n}\n\n# lsd\nIf (Get-Command lsd -ErrorAction SilentlyContinue) {\n\t${function:lsa} = { \u0026 lsd -a }\n}\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n\n### Shell Completions\n\nAll custom shell completion scripts and invokations are housed in the [Profile/completions](./Profile/completions) directory and dot sourced in via [Profile/completion.ps1](Profile/completion.ps1).\n\nIncluded are shell completions for the following tools:\n\n- PowerShell: Imported with `Microsoft.PowerShell.Utility` Module (see code below)\n\nplus,\n\n- AWS-CLI: [aws.ps1](Profile/completions/aws.ps1)\n- Chocolatey: [choco.ps1](Profile/completions/choco.ps1)\n- Docker: [docker.ps1](Profile/completions/docker.ps1) *(via `DockerCompletion` Module)*\n- DotNet: [dotnet.ps1](Profile/completions/dotnet.ps1)\n- GitHub-CLI: [gh-cli.ps1](Profile/completions/gh-cli.ps1)\n- Git-Cliff: [git-cliff.ps1](Profile/completions/git-cliff.ps1)\n- S (search): [s-search.ps1](Profile/completions/s-search.ps1)\n- Scoop: [scoop.ps1](Profile/completions/scoop.ps1) *(via `scoop-completion` Module)*\n- Spotify: [spotify.ps1](Profile/completions/spotify.ps1)\n- WinGet: [winget.ps1](Profile/completions/winget.ps1) \n- ffsend: [ffsend.ps1](Profile/completions/ffsend.ps1)\n\n*See [Profile/completion.ps1](Profile/completion.ps1):*\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./Profile/completion.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./Profile/completion.ps1 --\u003e\n```ps1\n# -------------------------\n# PowerShell Completion\n# -------------------------\n\nImport-Module Microsoft.PowerShell.Utility\n\n$files = Get-ChildItem -Path $(Get-Location) -Filter '*.ps1'\nForEach ($file in $files) {\n  . $file\n}\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n### Modules\n\nSee the [Appendix: Modules](#appendix-modules) for an idea of what modules I interact with regularly.\n\n- See [Profile/modules.ps1](Profile/modules.ps1) and the functions `Backup-Modules`, `Sync-Modules` and `Restore-Modules` that interact with [Modules/modules.yml](Modules/modules.yml).\n\n\u003cdetails\u003e\u003csummary\u003e🔎 View Code\u003c/summary\u003e\n \u003cp\u003e\n\n\u003c!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./Profile/modules.ps1) --\u003e\n\u003c!-- The below code snippet is automatically added from ./Profile/modules.ps1 --\u003e\n```ps1\n# -----------------------------\n# Modules and Helper Functions\n# -----------------------------\n\n# Required PSReadLine Beta Version\nIf (!(!((Get-Module -Name PSReadLine).Version.Major -ge 2)) -and (!(Get-Module -Name PSReadLine).Version.Minor -ge 2)) {\n    Install-Module -Name PSReadLine -AllowPrerelease -Force -AllowClobber -Scope CurrentUser\n}\n\nImport-Module -Name posh-git\nImport-Module -Name Terminal-Icons\n\n# Enable Posh-Git\n$env:POSH_GIT_ENABLED = $true\n```\n\u003c!-- MARKDOWN-AUTO-DOCS:END --\u003e\n \u003c/p\u003e\n\u003c/details\u003e\n\n## Scripts\n\n- Various powershell scripts for automation and configurations.\n\n## Functions\n\nCustom folder outside the scope of profile for housing snippets and past-work.\n\n***\n\n### Appendix: Modules\n\nVaries with time but common modules I utilize are:\n\n- 7Zip4PowerShell\n- AU\n- BurntToast\n- ChocolateyGet\n- ChocolateyProfile\n- DockerCompletion\n- Evergreen\n- Foil\n- InvokeBuild\n- ModuleBuild\n- oh-my-posh\n- PackageManagement\n- posh-git\n- Posh-SSH\n- Posh-Sysmon\n- powershell-yaml\n- PowerShellGet\n- psake\n- PSDepend\n- PSEverything\n- PSGithub\n- PSKubectlCompletion\n- PSFzf\n- PSProfiler\n- PSReadLine\n- PSScriptTools\n- PSTodoist\n- PSWindowsUpdate\n- scoop-completion\n- Terminal-Icons\n- WslInterop\n- ZLocation\n\n[^1]: About PowerShell Profiles: Here are the `$PROFILE` path's to various PowerShell 7 Profile Locations on Windows 11 (note that I am currently using OneDrive).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimbrig%2Fpowershell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimbrig%2Fpowershell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimbrig%2Fpowershell/lists"}