-
Notifications
You must be signed in to change notification settings - Fork 0
/
Microsoft.PowerShell_profile.ps1
48 lines (38 loc) · 1.37 KB
/
Microsoft.PowerShell_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
38
39
40
41
42
43
44
45
46
47
48
if (Test-Path "C:\Users\Administrator\.jabba\jabba.ps1") { . "C:\Users\Administrator\.jabba\jabba.ps1" }
$PROXY="http://127.0.0.1:7890"
function proxy{
$env:HTTP_PROXY=$PROXY;
$env:HTTPS_PROXY=$PROXY;
}
function unproxy{
$env:HTTP_PROXY="";
$env:HTTPS_PROXY="";
}
function javaenv{
$envRegKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\CurrentControlSet\Control\Session Manager\Environment', $true);
$envPath=$envRegKey.GetValue('Path', $null, "DoNotExpandEnvironmentNames").replace('%JAVA_HOME%\bin;', '');
[Environment]::SetEnvironmentVariable('JAVA_HOME', "$(jabba which $(jabba current))", 'Machine');
[Environment]::SetEnvironmentVariable('PATH', "%JAVA_HOME%\bin;$envPath", 'Machine');
}
function nvmenv{
nvm node_mirror https://npmmirror.com/mirrors/node/
nvm npm_mirror https://npmmirror.com/mirrors/npm/
}
nvmenv;
function myalias{
#Set-Alias grep Select-String -Scope Global;
Set-Alias open explorer -Scope Global;
Set-Alias ll ls -Scope Global;
Set-Alias subl "E:\devtools\Sublime Text\subl.exe" -Scope Global;
}
myalias;
function ohmyposh{
#Install-Module Terminal-Icons
#Import-Module Terminal-Icons
#Install-Module posh-git
Import-Module posh-git
[Console]::OutputEncoding = [Text.Encoding]::UTF8
#oh-my-posh init pwsh | Invoke-Expression;
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/simple.omp.json" | Invoke-Expression;
}
ohmyposh;