-
Notifications
You must be signed in to change notification settings - Fork 1
/
powershell.ps1
32 lines (25 loc) · 992 Bytes
/
powershell.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
Import-Module Pscx
# Import-Module "PowerTab" -ArgumentList "C:\Users\Dario\Documents\WindowsPowerShell\PowerTabConfig.xml"
$env:Path += ";$home\Applications\bin"
$env:HGEditor = $env:Editor = "emacs -nw"
function bzr {
if ($args[0] -eq "log"){
bzr.exe $args | less
} else {
bzr.exe $args
}
}
$Global:pshistory = "$home\Documents\WindowsPowerShell\log.csv"
$history = ("#TYPE Microsoft.PowerShell.Commands.HistoryInfo",
'Id","CommandLine","ExecutionStatus","StartExecutionTime","EndExecutionTime"')
if (Test-Path $pshistory) {
$history += (get-content $pshistory)
}
$history | Select -Unique | Convertfrom-csv -ErrorAction SilentlyContinue | Add-History
function prompt{
$hid = $myinvocation.historyID
if ($hid -gt 1) {
(get-history ($myinvocation.historyID -1 ) | convertto-csv)[-1] >> $pshistory
}
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
}