-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.ps1
48 lines (40 loc) · 1.44 KB
/
utils.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
function fsi () { & 'C:\Program Files\Microsoft F#\v4.0\Fsi.exe' $args[0] }
function here () {ii .}
function oshell () {ii C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe }
function ms () {
if($args[0] -eq $null) {
ls *.sln | % {C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe $_.Name}
} else {
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe $args[0]
}
}
function get-sln() {
ls -in *.sln -r | select -first 1 | %{ ii $_.FullName }
}
############################## ????
# LS.MSH
# Colorized LS function replacement
# /\/\o\/\/ 2006
# http://mow001.blogspot.com
function LL
{
param ($dir = ".", $all = $false)
$origFg = $host.ui.rawui.foregroundColor
if ( $all ) { $toList = ls -force $dir }
else { $toList = ls $dir }
foreach ($Item in $toList)
{
Switch ($Item.Extension)
{
".ps1" {$host.ui.rawui.foregroundColor = "Cyan"}
".Exe" {$host.ui.rawui.foregroundColor = "Yellow"}
".cmd" {$host.ui.rawui.foregroundColor = "Red"}
".msh" {$host.ui.rawui.foregroundColor = "Red"}
".vbs" {$host.ui.rawui.foregroundColor = "Red"}
Default {$host.ui.rawui.foregroundColor = $origFg}
}
if ($item.Mode.StartsWith("d")) {$host.ui.rawui.foregroundColor = "Green"}
$item
}
$host.ui.rawui.foregroundColor = $origFg
}