]> apps.delaporte.us Git - dotfiles.git/blob - Microsoft.PowerShell_profile.ps1
e0c2494cff86d3ff19180b9abde1fbcec9d12bf6
[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 $IsWindows = ($env:OS -eq "Windows_NT")
20 if($IsWindows){
21 $ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all
22 $ENV:PATH+=";C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\" # Python latest as of 2019 December
23 $ENV:PATH+=";C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin" # Docker for R Studio and Jupyter
24 $ENV:PATH+=";C:\Program Files (x86)\Common Files\Oracle\Java\javapath" # Don't remember why I still care about Java.
25 $ENV:PATH+=";C:\Program Files\Git\cmd" # Version control is nice.
26 $ENV:PATH+=";C:\ProgramData\chocolatey\bin" # Package management is nice.
27 $ENV:PATH+=";C:\Program Files\nodejs" # KataKoda wants to add tools via npm
28 $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in.
29
30 function Find-LargeFiles() {
31 Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, FullName
32 }
33
34 function List-DriveSpace() {
35 Get-PSDrive C | Select-Object Used,Free
36 }
37
38 }
39
40 # Import some home grown PowerShell modules, if they are installed.
41 $modPaths = @("C:\src\dotfiles\ToyBox\toybox.psm1")
42 $modPaths | ForEach-Object {
43 $_ | Format-Table
44 if(Test-Path -Path $_) {
45 Import-Module $_
46 Write-Host "Loaded $_"
47 }
48 }
49
50
51 function Export-VSCodeExtensions {
52 code --list-extensions | Out-File -FilePath /src/dotfiles/vscode-extensions.txt
53 Get-Content -Path /src/dotfiles/vscode-extensions.txt
54 }
55
56
57
58 # Linux-like up/down in shell
59 Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
60 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
61 Set-PSReadlineOption -HistorySavePath c:\temp\PSHistory.log
62
63 . C:\src\minion\minion_ps_alias.ps1
64
65 cd c:\src