From: EdTheDev Date: Sat, 30 Jan 2021 21:50:53 +0000 (-0600) Subject: Cleanup PS Profile X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/2e7bed97ff20c5f2adbd7c2fa897bac48e07b1c4?hp=f338ccb2d9d53c127649a34c8ae73b9365a58d2f Cleanup PS Profile --- diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 64fd37c..bd16cbb 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,7 +1,4 @@ - -## Setup reminder: -# code $profile -# Set-ExecutionPolicy RemoteSigned +# .EXAMPLE # . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1 Import-Module posh-git @@ -12,32 +9,16 @@ Import-Module posh-git #} $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'') -# Kali linux env -$ENV:PATH +=":/home/delaport/development/flutter/bin" # Flutter in Kali under WSL - -# Some Paths that are annoying to find/restore if the installer fails if($IsWindows -eq "") { # Bootstrap for older PowerShell $IsWindows = ($env:OS -eq "Windows_NT") } if($IsWindows){ + # Some Paths that are annoying to find/restore if the installer fails $ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all - $ENV:PATH+=";C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\" # Python latest as of 2019 December - $ENV:PATH+=";C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin" # Docker for R Studio and Jupyter - $ENV:PATH+=";C:\Program Files (x86)\Common Files\Oracle\Java\javapath" # Don't remember why I still care about Java. $ENV:PATH+=";C:\Program Files\Git\cmd" # Version control is nice. $ENV:PATH+=";C:\ProgramData\chocolatey\bin" # Package management is nice. - $ENV:PATH+=";C:\Program Files\nodejs" # KataKoda wants to add tools via npm $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in. - - function Find-LargeFiles() { - Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, FullName - } - - function List-DriveSpace() { - Get-PSDrive C | Select-Object Used,Free - } - } # Import some home grown PowerShell modules, if they are installed. @@ -50,14 +31,6 @@ $modPaths | ForEach-Object { } } - -function Export-VSCodeExtensions { - code --list-extensions | Out-File -FilePath /src/dotfiles/vscode-extensions.txt - Get-Content -Path /src/dotfiles/vscode-extensions.txt -} - - - # Linux-like up/down in shell Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward diff --git a/Toybox/toybox.psm1 b/Toybox/toybox.psm1 index 4b7d1e5..00824b2 100644 --- a/Toybox/toybox.psm1 +++ b/Toybox/toybox.psm1 @@ -5,3 +5,20 @@ $TOYBOX_ROOT = "C:\src\dotfiles\toybox" # } # Export-ModuleMember -Function Start-DockerPythonWhatever +# +function Find-LargeFiles() { + Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, FullName +} + +function List-DriveSpace() { + Get-PSDrive C | Select-Object Used,Free +} + +# function Export-VSCodeExtensions { +# code --list-extensions | Out-File -FilePath /src/dotfiles/vscode-extensions.txt +# Get-Content -Path /src/dotfiles/vscode-extensions.txt +#} + +Export-ModuleMember -Function List-DriveSpace +Export-ModuleMember -Function List-LargeFiles + diff --git a/cheatsheets/paths.md b/cheatsheets/paths.md new file mode 100644 index 0000000..4aad325 --- /dev/null +++ b/cheatsheets/paths.md @@ -0,0 +1,11 @@ + +```powershell + $ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all + $ENV:PATH+=";C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\" # Python latest as of 2019 December + $ENV:PATH+=";C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin" # Docker for R Studio and Jupyter + $ENV:PATH+=";C:\Program Files (x86)\Common Files\Oracle\Java\javapath" # Don't remember why I still care about Java. + $ENV:PATH+=";C:\Program Files\Git\cmd" # Version control is nice. + $ENV:PATH+=";C:\ProgramData\chocolatey\bin" # Package management is nice. + $ENV:PATH+=";C:\Program Files\nodejs" # KataKoda wants to add tools via npm + $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in. +``` diff --git a/setup/powershell.ps1 b/setup/powershell.ps1 new file mode 100644 index 0000000..d422a12 --- /dev/null +++ b/setup/powershell.ps1 @@ -0,0 +1 @@ +Set-ExecutionPolicy RemoteSigned diff --git a/vimrc b/vimrc index c5abfc2..fb601cb 100644 --- a/vimrc +++ b/vimrc @@ -62,3 +62,4 @@ set tabstop=2 set shiftwidth=2 colorscheme slate +set number