-
Notifications
You must be signed in to change notification settings - Fork 0
/
Set-VS2010SourceServerExtractToDirectory.ps1
128 lines (114 loc) · 6.56 KB
/
Set-VS2010SourceServerExtractToDirectory.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
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
#requires -version 2.0
# Wintellect .NET Debugging Code
# (c) 2009 by John Robbins\Wintellect - Do whatever you want to do with it
# as long as you give credit.
<#.SYNOPSIS
Sets the Visual Studio 2010 Source Server Cache directory. This option is not
exposed throught the normal Visual Studio settings.
.DESCRIPTION
Sets the source server cache directory. It's a very good idea to set the cache
directory to the same values for Visual Studio and WinDBG. That way you get the
benefit if one debugger downloads the source from your version control the other
does not have to.
.PARAMETER Directory
The directory to use. If the directory does not exist, it will be created.
#>
param (
[Parameter(Mandatory=$true,
HelpMessage="Please specify the directory for source extraction")]
[string] $Directory
)
function CreateDirectoryIfNeeded ( [string] $directory )
{
if ( ! ( Test-Path $directory -type "Container" ) )
{
New-Item -type directory -Path $directory > $null
}
}
$vs2010DebuggerPath = "HKCU:\Software\Microsoft\VisualStudio\10.0\Debugger\"
$sourceServExtractTo = "SourceServerExtractToDirectory"
$currDir = (Get-ItemProperty $vs2010DebuggerPath).$sourceServExtractTo
Write "The old source cache directory was $currDir"
CreateDirectoryIfNeeded $Directory
Set-ItemProperty -path $vs2010DebuggerPath -name $sourceServExtractTo -value $Directory
Write "The new source cache directory is $Directory"
# SIG # Begin signature block
# MIIOkQYJKoZIhvcNAQcCoIIOgjCCDn4CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSg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