File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
custom-completions/windows Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ export module win {
2+
3+ # open in visual studio
4+ export def "open in visual-studio" [file : path ] {
5+ let file = ($file | path expand )
6+ let vs = ' C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe'
7+ if (not ($vs | path exists )) {
8+ error make {msg : $" ($vs ) not found, please edit 'open in visual-studio' function in ($env .CURRENT_FILE )" }
9+ }
10+ run-external $vs /Edit $file
11+ }
12+
13+ def "nu-complete procs" [] { ps | select pid name | sort-by name | rename - c { pid : value , name: description } }
14+
15+ export def "windbg attach-to-process" [ -- pid(-p) : int @" nu-complete procs" ] {
16+ let windbg = ' ~/AppData/Local/Microsoft/WindowsApps/WinDbgX.exe'
17+ if (not ($windbg | path exists )) {
18+ error make {msg : $" ($windbg ) not found, please edit 'windbg attach-to-process' function in ($env .CURRENT_FILE )" }
19+ }
20+ run-external $windbg " -p" $pid
21+ }
22+
23+ # file version and signature viewer from file
24+ export def "read version" [file : path ] {
25+ ^ sigcheck - nobanner $file | lines | skip 1 | parse -- regex ' \s*(?<name>.+?):(?<value>.+)'
26+ }
27+
28+ # application for CPU spikes, unhandled exception and hung window monitoring cli tool
29+ #
30+ # https://learn.microsoft.com/en-us/sysinternals/downloads/procdump#using-procdump
31+ #
32+ # Examples:
33+ # Install ProcDump as the (AeDebug) postmortem debugger:
34+ # procdump -ma -i c:\dumps
35+ #
36+ # Uninstall ProcDump as the (AeDebug) postmortem debugger:
37+ # procdump -u
38+ export extern "procdump" [ ... args : any ]
39+
40+ }
41+
You can’t perform that action at this time.
0 commit comments