]> apps.delaporte.us Git - dotfiles.git/blob - Microsoft.PowerShell_profile.ps1
Moving stuff around for vim setup
[dotfiles.git] / Microsoft.PowerShell_profile.ps1
1
2 ## Setup reminder:
3 # code $profile
4 # Set-ExecutionPolicy RemoteSigned
5 # . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1
6
7 Import-Module posh-git
8 # Courtesty of MKletz
9 # Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process {
10 # $Path = Split-Path -Path $_.Directory -Parent
11 # $env:PSModulePath = $env:PSModulePath + ";$($Path)"
12 #}
13 $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
14
15 # Kali linux env
16 $ENV:PATH +=":/home/delaport/development/flutter/bin" # Flutter in Kali under WSL
17
18 # Some Paths that are annoying to find/restore if the installer fails
19 if($IsWindows -eq "") {
20 # Bootstrap for older PowerShell
21 $IsWindows = ($env:OS -eq "Windows_NT")
22 }
23 if($IsWindows){
24 $ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all
25 $ENV:PATH+=";C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\" # Python latest as of 2019 December
26 $ENV:PATH+=";C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin" # Docker for R Studio and Jupyter
27 $ENV:PATH+=";C:\Program Files (x86)\Common Files\Oracle\Java\javapath" # Don't remember why I still care about Java.
28 $ENV:PATH+=";C:\Program Files\Git\cmd" # Version control is nice.
29 $ENV:PATH+=";C:\ProgramData\chocolatey\bin" # Package management is nice.
30 $ENV:PATH+=";C:\Program Files\nodejs" # KataKoda wants to add tools via npm
31 $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in.
32
33 function Find-LargeFiles() {
34 Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, FullName
35 }
36
37 function List-DriveSpace() {
38 Get-PSDrive C | Select-Object Used,Free
39 }
40
41 }
42
43 # Import some home grown PowerShell modules, if they are installed.
44 $modPaths = @("C:\src\dotfiles\ToyBox\toybox.psm1")
45 $modPaths | ForEach-Object {
46 $_ | Format-Table
47 if(Test-Path -Path $_) {
48 Import-Module $_
49 Write-Host "Loaded $_"
50 }
51 }
52
53
54 function Export-VSCodeExtensions {
55 code --list-extensions | Out-File -FilePath /src/dotfiles/vscode-extensions.txt
56 Get-Content -Path /src/dotfiles/vscode-extensions.txt
57 }
58
59
60
61 # Linux-like up/down in shell
62 Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
63 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
64 Set-PSReadlineOption -HistorySavePath c:\temp\PSHistory.log
65
66 . C:\src\minion\minion_ps_alias.ps1
67
68 cd c:\src