https://github.com/frigus02/powershell-profile
My personal PowerShell profile
https://github.com/frigus02/powershell-profile
Last synced: over 1 year ago
JSON representation
My personal PowerShell profile
- Host: GitHub
- URL: https://github.com/frigus02/powershell-profile
- Owner: frigus02
- License: mit
- Created: 2016-10-22T15:31:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T19:40:13.000Z (almost 6 years ago)
- Last Synced: 2024-10-06T09:41:26.350Z (almost 2 years ago)
- Language: PowerShell
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PowerShell Profile
This contains my personal PowerShell profile. It's inspired by Matt McNabb, who explains how he setup his profile in the blog post [Take Your Powershell Profile on the Road](http://mattmcnabb.github.io/portable-profile).
## Prerequisites
Install Starship prompt:
```posh
scoop install sharship
```
## Usage
Clone the repository and create a PowerShell profile with the follwing content:
```posh
# Import profile
. "C:\repos\powershell-profile\profiles\default.ps1"
# Configure project directory for project-helpers module
Set-ProjectDirectory -Directory "C:\repos"
Set-VisualStudioPath -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015.lnk"
Set-EditorPath -Path "code"
```
To find the location of your profile file, open a PowerShell window and print the variable `$PROFILE`. If the referenced file does not exist yet, just create it. More information can be found in the post [Understanding the six Windows PowerShell profiles](https://blogs.technet.microsoft.com/heyscriptingguy/2012/05/21/understanding-the-six-powershell-profiles/).
## More useful modules
### Docker
```posh
Install-Module -Scope CurrentUser DockerCompletion
```
### Bash Completions
```posh
# Install
Install-Module -Scope CurrentUser PSBashCompletions
# Completions
((kubectl completion bash) -join "`n") | Set-Content -Encoding ASCII -NoNewline -Path $env:USERPROFILE\Documents\WindowsPowerShell\kubectl_completions.sh
# Use in profile
Import-Module PSBashCompletions
Register-BashArgumentCompleter kubectl $env:USERPROFILE\Documents\WindowsPowerShell\kubectl_completions.sh
Set-Alias k kubectl
Register-BashArgumentCompleter k $env:USERPROFILE\Documents\WindowsPowerShell\kubectl_completions.sh
```