My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
$env:path += ";C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\"
$env:path += ";C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\"
$env:path += ";C:\Windows\Microsoft.NET\Framework\v4.0.30319"
$env:path += ";C:\Windows\Microsoft.NET\Framework\v3.5"
$env:path += ";C:\Program Files\Vim\vim72"
$env:path += ";C:\svn"
$env:path += ";C:\msysgit\bin"
$env:path += ";C:\cygwin\bin"
$env:path += ";C:\ruby\bin"
$env:path += ";C:\emacs\emacs-23.1\bin"
$env:path += ";C:\Program Files\Reflector"
$env:path += ";C:\cygwin\bin"
$env:path += ";" + (($env:windir) + "\system32\inetsrv")

function global:hello {
write-host $(get-content env:computername) -fore yellow
}

function global:devenv {
$args | %{ devenv.exe (Resolve-Path $_) }
}

function global:touch {
set-content -Path ($args[0]) -Value ([String]::Empty)
}

function global:editor {
$args | %{ e.exe (Resolve-Path $_) }
}

function global:sqlreset {
NET STOP MSSQLSERVER
NET START MSSQLSERVER
}

function global:kill-process([string] $process_name){
Get-Process | Where { $_.Name -Eq $process_name } | Kill
$msg = "{0} was killed" -f $process_name
write-host $msg -fore yellow
}

function global:iiskill {
kill-process w3wp
}

function global:vi {
$args | %{ vim.exe (Resolve-Path $_) }
}

function global:emacs {
runemacs.exe -fs -Q
}

function global:setup-shell {
(Get-Host).UI.RawUI.BufferSize = (Get-Host).UI.RawUI.MaxPhysicalWindowSize
(Get-Host).UI.RawUI.WindowSize = (Get-Host).UI.RawUI.MaxPhysicalWindowSize
# (Get-Host).UI.RawUI.WindowTitle = 'Command'
$host.ui.rawui.windowtitle = $(get-location)
write-host ($(get-date).tostring("dd HH:mm:ss") + ">") -nonewline - foregroundcolor gray
return " "
}

function global:grep {
get-childitem -include ($args[0]) -recurse | select-string -pattern ($args[1])
}

function global:cassini {
webdev.webserver.exe $args
}

function global:cassinikill {
kill-process WebDev.WebServer
}

function global:hosts {
editor \Windows\System32\drivers\etc\hosts
}

function global:install-file([string] $urlPath) {
$filename = download-file($urlPath)
invoke-item $filename
}

function global:download-file([string] $urlPath) {
$urlSplit = $urlPath.split('/')
$filename = (Resolve-Path .\).ToString() + '\' + $urlSplit[$urlSplit.length - 1]
$webclient = New-Object "System.Net.WebClient"
$webclient.DownloadFile($urlPath, $filename)
return $filename
}

function global:install-ruby {
install-file http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe
}

function global:install-git {
install-file http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe
}

function global:install-cygwin {
install-file http://www.cygwin.com/setup.exe
}

function global:install-svn {
install-file http://downloads-guests.open.collab.net/files/documents/61/1635/CollabNetSubversion-client-1.5.6-2.win32.exe
}

function global:install-emacs {
install-file http://ftp.gnu.org/gnu/emacs/windows/emacs-23.1-bin-i386.zip
}

function global:install-e {
install-file http://www.e-texteditor.com/download/e_setup.exe
}

function global:curl([string] $urlPath) {
$webclient = New-Object "System.Net.WebClient"
return $webclient.DownloadString($urlPath)
}

function global:delete-hidden-svn-directories(){
ls -fo -re | where {$_.mode -match "d"} | where {$_.name -match ".svn"} | rm -fo
}

function global:delete-debug-directories(){
ls -fo -re | where {$_.mode -match "d"} | where {$_.name -match "debug"} | rm -fo -re
}


function global:reflector(){
$args | %{ Reflector.exe (Resolve-Path $_) }
}

function global:tfs-checkout([string] $filename){
tf checkout $filename
e $filename
}

function global:gcc(){
gcc-3.exe $args
}

function global:tfs-get{
tf get .\ /recursive
}

function global:tfs-merge([string] $filename1, [string] $filename2){
tf merge /baseless (Resolve-Path $filename1) (Resolve-Path $filename1) /recursive
}

function global:config-debug-off{
$configFile = (Resolve-Path web.config)

$webConfig = [xml](Get-Content $configFile)

$webConfig.SelectSingleNode('//system.web/customErrors').RemoveAll()
$webConfig.SelectSingleNode('//system.webServer/httpErrors').RemoveAll()

$webConfig.Save($configFile)
}

#Cygwin compiler aliases
function global:gcc{
gcc-3.exe $args
}

function global:cc{
gcc
}

function global:c++{
gcc
}

function global:get-assembly-name([string] $assemblyName){
$assembly = ([System.Reflection.Assembly]::Loadfile( (resolve-path $assemblyName) ))
write-host $assembly.GetName()
$assembly = $null
}


function global:list-w3wp{
write-host $(appcmd list wp) -Separator `n -fore green
}
function global:list-wp{
list-w3wp
}

#ideas:
# remove custom errors from web.config files

Change log

r68 by kahtava on Nov 17, 2010   Diff
New function to resolve w3wp processes
(iis worker processes) to their respective
sites. A short cut for appcmd.exe list wp
Go to: 
Sign in to write a code review

Older revisions

r67 by kahtava on Oct 21, 2010   Diff
Modified directory paths to make use
of Visual Studio 2010 and .NET 4.0.xx
r66 by kahtava on Aug 31, 2010   Diff
Format updates
r65 by kahtava on Aug 31, 2010   Diff
Added get-assembly-name
All revisions of this file

File info

Size: 4942 bytes, 190 lines
Powered by Google Project Hosting