-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMicrosoft.PowerShell_profile.ps1
57 lines (45 loc) · 1.56 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
49
50
51
52
53
54
55
56
57
function Color-Console {
$Host.ui.rawui.backgroundcolor = "black"
$Host.ui.rawui.foregroundcolor = "green"
$hosttime = (Get-ChildItem -Path $PSHOME\pwsh.exe).CreationTime
$hostversion="$($Host.Version.Major)`.$($Host.Version.Minor)"
$Host.UI.RawUI.WindowTitle = "PowerShell $hostversion ($hosttime)"
Clear-Host
}
$work1="D:\Work"
$work2="D:\WorkColectoresWeb"
$javaHome="D:\WorkColectoresWeb\Java\jdk"
$mavenHome="D:\Work\Java\apache-maven-3.8.5-bin"
$wgetBin="D:\WorkColectoresWeb\Native\wget\bin"
$smartGit="D:\Work\Java\SmartGit"
$gitHome="D:\Work\Native\Git"
$gitbashCommand="$gitHome\git-bash.exe --cd-to-home"
$editor="notepad++"
$editarProfileCmd="$editor C:\Users\jurivera\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"
$notepadPlusplusHome="D:\Work\Native\Notepad++"
$notepadPlusplusCmd="$notepadPlusplusHome\notepad++.exe"
$netbeansScript="D:\WorkColectoresWeb\Java\netbeans-col-web.ps1"
function setVariables {
Set-Content -Path Env:\JAVA_HOME -Value "$javaHome"
Set-Content -Path Env:\MAVEN_HOME -Value "$mavenHome"
Set-Content -Path Env:\SMARTGIT_HOME -Value "$smartGit"
Set-Content -Path Env:\PATH -Value "$notepadPlusplusHome;$gitHome;$gitHome\bin;$smartGit\bin;$mavenHome\bin;$javaHome\bin;$wgetBin;$Env:PATH"
}
function goWork ($folder) {
cd $folder
}
function netbeans {
powershell -file $netbeansScript
}
function openGit {
powershell -command $gitbashCommand
}
function notepadPlusplus {
powershell -command $notepadPlusplusCmd
}
function editProfile {
powershell -command $editarProfileCmd
}
setVariables
Color-Console
goWork $work2