Skip to content

Commit 2ed2f90

Browse files
committed
chore: windows
1 parent 9560df9 commit 2ed2f90

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
export module win {
2+
3+
# open in visual studio
4+
export def "open in vs-2022" [file: path] {
5+
let file = ($file | path expand)
6+
let vs = `C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe` # TODO: read loc from reg?
7+
run-external $vs /Edit $file
8+
}
9+
10+
def "nu-complete procs" [] { ps | select pid name | sort-by name | rename -c { pid: value, name: description } }
11+
12+
export def "windbg attach-to-process" [
13+
--pid(-p): int@"nu-complete procs" # process-id
14+
] {
15+
let windbg = '~/AppData/Local/Microsoft/WindowsApps/WinDbgX.exe' # TODO: read loc from reg?
16+
run-external $windbg "-p" $pid
17+
}
18+
19+
# file version and signature viewer from file
20+
export def "read version" [file: path] {
21+
^sigcheck -nobanner $file | lines | skip 1 | parse --regex '\s*(?<name>.+?):(?<value>.+)'
22+
}
23+
24+
# https://learn.microsoft.com/en-us/sysinternals/downloads/procdump#using-procdump
25+
#
26+
# Examples:
27+
# Install ProcDump as the (AeDebug) postmortem debugger:
28+
# procdump -ma -i c:\dumps
29+
#
30+
# Uninstall ProcDump as the (AeDebug) postmortem debugger:
31+
# procdump -u
32+
export extern "procdump" [ ...args: any ]
33+
34+
}
35+

0 commit comments

Comments
 (0)