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