-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.ps1
executable file
·37 lines (30 loc) · 930 Bytes
/
profile.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# my PS profile
Set-Alias grep Select-String
# used "ripgrep" for grep, but not anymore.
function grep_rg{
$count = @($input).Count
$input.Reset()
if ($count) {
$input | rg.exe --hidden $args
}
else {
rg.exe --hidden $args
}
}
# `Equivalent of *Nix 'which' command in Powershell? <http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell>`_::
function which($name) {
Get-Command $name | Select-Object -ExpandProperty Definition
}
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
# import posh-docker if it had been installed
if (Get-Module -ListAvailable -Name posh-docker) {
Import-Module posh-docker
#Write-Host "Module exists"
} else {
#Write-Host "Module does not exist"
# install here if wanted
}