-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathSymbolsSource.ps1
More file actions
753 lines (643 loc) · 29.3 KB
/
SymbolsSource.ps1
File metadata and controls
753 lines (643 loc) · 29.3 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
#requires -version 5.0
###############################################################################
# WintellectPowerShell Module
# Copyright (c) 2010-2017 - John Robbins/Wintellect
#
# Do whatever you want with this module, but please do give credit.
###############################################################################
# Always make sure all variables are defined and all best practices are
# followed.
Set-StrictMode -version Latest
###############################################################################
# Script Global Variables
###############################################################################
# The array that contains all the versions.
$script:vsVersionArray = "2012", "2013", "2015", "2017", "2019"
###############################################################################
# Module Only Functions
###############################################################################
# Does the lookups and builds the hash tables for Get-SourceServer, Get-SymbolServer
function GetCommonSettings($propertyValue="", $envVariable="")
{
$returnHash = [ordered]@{}
# The XPath to look for.
$xPathLookup = $script:dbgPropertyXPath -f $propertyValue
# Loop through all the VS versions.
for ($i = 0; $i -lt $script:vsVersionArray.Length; $i++)
{
[xml]$settings = OpenSettingsFile $script:vsVersionArray[$i]
if ($null -ne $settings)
{
# Look for the property itself.
$propNode = $settings | Select-Xml -XPath $xPathLookup
# Add the value to the hash table.
$returnHash["VS " + $script:vsVersionArray[$i]] = $propNode.Node.InnerText
}
}
# Do the environment variable, too.
if ($envVariable -ne "")
{
$envVal = Get-ItemProperty -Path HKCU:\Environment -Name $envVariable -ErrorAction SilentlyContinue
if ($null -ne $envVal)
{
$returnHash[$envVariable] = $envVal.$envVariable
}
}
return $returnHash
}
function CreateDirectoryIfNeeded
{
[CmdletBinding(SupportsShouldProcess=$true)]
param (
[string] $directory=""
)
if ($PSCmdlet.ShouldProcess($directory,"Creating directory"))
{
if ( ! (Test-Path -Path $directory -type "Container"))
{
New-Item -type directory -Path $directory > $null
}
}
}
# Makes doing ShouldProcess easier.
function Set-ItemPropertyScript
{
[CmdletBinding(SupportsShouldProcess=$true)]
param
(
[Parameter(Mandatory=$true)]
$path,
[Parameter(Mandatory=$true)]
$name,
[Parameter(Mandatory=$true)]
$value,
$type=$null
)
$propString = "Item: " + $path.ToString() + " Property: " + $name
if ($PSCmdLet.ShouldProcess($propString ,"Set Property"))
{
if ($null -eq $type)
{
Set-ItemProperty -Path $path -Name $name -Value $value
}
else
{
Set-ItemProperty -Path $path -Name $name -Value $value -Type $type
}
}
}
function SetInternalSymbolServer([xml]$settings, $cacheDirectory, $symPath)
{
CreateDirectoryIfNeeded -directory $CacheDirectory
# Turn off Just My Code.
$xPathLookup = $script:dbgPropertyXPath -f "JustMyCode"
$justMyCode = $settings | Select-Xml -XPath $xPathLookup
$justMyCode.Node.InnerText = "0"
# Turn on Source Server Diagnostics as that's a good thing. :)
$xPathLookup = $script:dbgPropertyXPath -f "ShowSourceServerDiagnostics"
$ssDiag = $settings | Select-Xml -XPath $xPathLookup
$ssDiag.Node.InnerText = "1"
# Turn off .NET Framework Source stepping.
$xPathLookup = $script:dbgPropertyXPath -f "FrameworkSourceStepping"
$noFramework = $settings | Select-Xml -XPath $xPathLookup
$noFramework.Node.InnerText = "0"
# Turn off using the Microsoft symbol servers.
$xPathLookup = $script:dbgPropertyXPath -f "SymbolUseMSSymbolServers"
$noMSSymServers = $settings | Select-Xml -XPath $xPathLookup
$noMSSymServers.Node.InnerText = "0"
# Set the symbol cache dir to the same value as used in the environment
# variable.
$xPathLookup = $script:dbgPropertyXPath -f "SymbolCacheDir"
$cacheDir = $settings | Select-Xml -XPath $xPathLookup
$cacheDir.Node.InnerText = $CacheDirectory
}
function SetPublicSymbolServer([xml]$settings, $cacheDirectory, $symPath, $vsVersion)
{
CreateDirectoryIfNeeded -directory $CacheDirectory
# Turn off Just My Code.
$xPathLookup = $script:dbgPropertyXPath -f "JustMyCode"
$justMyCode = $settings | Select-Xml -XPath $xPathLookup
$justMyCode.Node.InnerText = "0"
# Turn on .NET Framework Source stepping.
$xPathLookup = $script:dbgPropertyXPath -f "FrameworkSourceStepping"
$noFramework = $settings | Select-Xml -XPath $xPathLookup
$noFramework.Node.InnerText = "1"
# Turn on Source Server Support.
$xPathLookup = $script:dbgPropertyXPath -f "UseSourceServer"
$useSS = $settings | Select-Xml -XPath $xPathLookup
$useSS.Node.InnerText = "1"
# Turn on Source Server Diagnostics as that's a good thing. :)
$xPathLookup = $script:dbgPropertyXPath -f "ShowSourceServerDiagnostics"
$ssDiag = $settings | Select-Xml -XPath $xPathLookup
$ssDiag.Node.InnerText = "1"
# It's very important to turn off requiring the source to match exactly.
# With this flag on, .NET Reference Source Stepping doesn't work.
$xPathLookup = $script:dbgPropertyXPath -f "UseDocumentChecksum"
$noDoc = $settings | Select-Xml -XPath $xPathLookup
$noDoc.Node.InnerText = "0"
# Turn off using the Microsoft symbol servers.
$xPathLookup = $script:dbgPropertyXPath -f "SymbolUseMSSymbolServers"
$noMSSymServers = $settings | Select-Xml -XPath $xPathLookup
$noMSSymServers.Node.InnerText = "0"
# Set the VS SymbolPath setting.
$xPathLookup = $script:dbgPropertyXPath -f "SymbolPath"
$symPath = $settings | Select-Xml -XPath $xPathLookup
$symPath.Node.IsEmpty = $true
# Tell VS that all paths are empty.
$xPathLookup = $script:dbgPropertyXPath -f "SymbolPathState"
$symPathState = $settings | Select-Xml -XPath $xPathLookup
$symPathState.Node.IsEmpty = $true
# Set the symbol cache dir to the same value as used in the environment
# variable.
$xPathLookup = $script:dbgPropertyXPath -f "SymbolCacheDir"
$cacheDir = $settings | Select-Xml -XPath $xPathLookup
$cacheDir.Node.InnerText = $CacheDirectory
# Turn on the SourceLinking option new to VS 2017.
if ($vsVersion -ge "2017")
{
$xPathLookup = $script:dbgPropertyXPath -f "UseSourceLink"
$ssDiag = $settings | Select-Xml -XPath $xPathLookup
$ssDiag.Node.InnerText = "1"
}
}
###############################################################################
# Public Cmdlets
###############################################################################
function Get-SourceServer
{
<#
.SYNOPSIS
Returns a hashtable of the current source server settings.
.DESCRIPTION
Returns a hashtable with the current source server directories settings
for VS 2012-2017, and the _NT_SOURCE_PATH enviroment variable
used by WinDBG.
.OUTPUTS
HashTable
The keys are, if all present, VS 2012-2017, and WinDBG.
The values are those set for each debugger.
.LINK
http://www.wintellect.com/devcenter/author/jrobbins
https://github.com/Wintellect/WintellectPowerShell
#>
GetCommonSettings SourceServerExtractToDirectory _NT_SOURCE_PATH
}
###############################################################################
function Get-SymbolServer
{
<#
.SYNOPSIS
Returns a hashtable of the current symbol server settings.
.DESCRIPTION
Returns a hashtable with the current source server directories settings
for VS 2012-2017, and the _NT_SYMBOL_PATH enviroment variable.
.LINK
http://www.wintellect.com/devcenter/author/jrobbins
https://github.com/Wintellect/WintellectPowerShell
#>
GetCommonSettings SymbolCacheDir _NT_SYMBOL_PATH
}
###############################################################################
function Set-SourceServer
{
<#
.SYNOPSIS
Sets the source server directory.
.DESCRIPTION
Sets the source server cache directory for VS 2012-2017, and WinDBG
through the _NT_SOURCE_PATH environment variable to all reference the same
location. This ensures you only download the file once no matter which
debugger you use. Because this cmdlet sets an environment variable you need
to log off to ensure it's properly set.
.PARAMETER CacheDirectory
The directory to use. If the directory does not exist, it will be created.
.PARAMETER CurrentEnvironmentOnly
If specified will only set the current PowerShell window _NT_SOURCE_PATH
environment variable and not overwrite the global settings. This is primarily
for use with WinDBG as Visual Studio does not use this environment variable.
.LINK
http://www.wintellect.com/devcenter/author/jrobbins
https://github.com/Wintellect/WintellectPowerShell
#>
[CmdletBinding(SupportsShouldProcess=$true)]
# This triggers on the environment variable setting ($env:_NT_SOURCE_PATH = "SRV*" + $CacheDirectory)
# That seems like an issue in the rule.
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Scope="Function")]
param (
[Parameter(Mandatory=$true,
HelpMessage="Please specify the source server cache directory")]
[string] $CacheDirectory,
[switch] $CurrentEnvironmentOnly
)
# Check if VS is running if we are going to be setting the global stuff.
if (($CurrentEnvironmentOnly -eq $false) -and (Get-Process -Name 'devenv' -ErrorAction SilentlyContinue))
{
throw "Visual Studio is running. Please close all instances before executing Set-SourceServer"
}
# Does the cache directory exist or need to be created?
CreateDirectoryIfNeeded $CacheDirectory
# If just setting the current environment, that's easy.
if ($CurrentEnvironmentOnly)
{
$env:_NT_SOURCE_PATH = "SRV*" + $CacheDirectory
}
else
{
# The XPath to look for.
$xPathLookup = $script:dbgPropertyXPath -f "SourceServerExtractToDirectory"
# Loop through all VS versions.
for ($i = 0; $i -lt $script:vsVersionArray.Length; $i++)
{
[xml]$settings = OpenSettingsFile $script:vsVersionArray[$i]
if ($null -ne $settings)
{
if ($PSCmdlet.ShouldProcess("VS " + $script:vsVersionArray[$i], "Setting Source Server"))
{
# Grab the SourceServerExtractToDirectory element
$extractDirNode = $settings | Select-Xml -XPath $xPathLookup
# Set it.
$extractDirNode.Node.InnerXml = $CacheDirectory
WriteSettingsFile $script:vsVersionArray[$i] $settings
}
}
}
# Always set the _NT_SOURCE_PATH value for WinDBG.
Set-ItemProperty -Path HKCU:\Environment -Name _NT_SOURCE_PATH -Value "SRV*$CacheDirectory"
}
if ($CurrentEnvironmentOnly)
{
Write-Verbose -Message "`nThe _NT_SOURCE_PATH environment variable was updated for this window only`n"
}
else
{
Write-Verbose -Message "`nPlease log out to activate the new source server settings`n"
}
}
###############################################################################
function Set-SymbolServer
{
<#
.SYNOPSIS
Sets up a computer to use a symbol server.
DESCRIPTION
Sets up both the _NT_SYMBOL_PATH environment variable as well as VS 2012-2017,
(for all installed) to use a common symbol cache directory as well as common
symbol servers. Optionally can be used to only set _NT_SYMBOL_PATH for an
individual PowerShell window.
.PARAMETER Internal
Sets the symbol server to use to http://SymWeb. Visual Studio will not use the
public symbol servers. This will turn off the .NET Framework Source Stepping.
This switch is intended for internal Microsoft use only. You must specify either
-Internal or -Public to the script.
.PARAMETER Public
Sets the symbol server to use as the two public symbol servers from Microsoft.
All the appropriate settings are configured to properly have .NET Reference
Source stepping working and for VS 2017 and above, Source Linking turned on
so you can debug GitHub-based repositories, like .NET Core, etc.
.PARAMETER CacheDirectory
Defaults to C:\SYMBOLS\PUBLIC for -Public and C:\SYMBOLS\INTERNAL for -Internal.
.PARAMETER SymbolServers
A string array of additional symbol servers to use. If -Internal is set, these
additional symbol servers will appear before HTTP://SYMWEB. If -Public is set,
these symbol servers will appear before the public symbol servers so both the
environment variable and Visual Studio have the same search order.
.PARAMETER CurrentEnvironmentOnly
If specified will only set the current PowerShell window _NT_SYMBOL_PATH
environment variable and not overwrite the global settings. This is primarily
for use with WinDBG as Visual Studio requires settings files for the
cache directory.
.LINK
http://www.wintellect.com/devcenter/author/jrobbins
https://github.com/Wintellect/WintellectPowerShell
#>
[CmdLetBinding(SupportsShouldProcess=$true)]
param ( [switch] $Internal,
[switch] $Public,
[string] $CacheDirectory="",
[string[]] $SymbolServers=@(),
[switch] $CurrentEnvironmentOnly)
# Do the parameter checking.
if ($Internal -eq $Public)
{
throw "You must specify either -Internal or -Public"
}
# Check if VS is running if we are going to be setting the global stuff.
if (($CurrentEnvironmentOnly -eq $false) -and (Get-Process -Name 'devenv' -ErrorAction SilentlyContinue))
{
throw "Visual Studio is running. Please close all instances before running Set-SymbolServer"
}
if ($Internal)
{
if ($CacheDirectory.Length -eq 0)
{
$CacheDirectory = "C:\SYMBOLS\INTERNAL"
}
$symPath = ""
for ($i = 0 ; $i -lt $SymbolServers.Length ; $i++)
{
$symPath += "SRV*$CacheDirectory*"
$symPath += $SymbolServers[$i]
$symPath += ";"
}
$symPath += "SRV*$CacheDirectory*http://SYMWEB"
if ($CurrentEnvironmentOnly)
{
CreateDirectoryIfNeeded -directory $CacheDirectory
$env:_NT_SYMBOL_PATH = $symPath
}
else
{
# Set the environment variable.
Set-ItemPropertyScript HKCU:\Environment _NT_SYMBOL_PATH $symPath
for ($i = 0; $i -lt $script:vsVersionArray.Length; $i++)
{
[xml]$settings = OpenSettingsFile $script:vsVersionArray[$i]
if ($null -ne $settings)
{
if ($PSCmdlet.ShouldProcess("VS "+ $script:vsVersionArray[$i], "Symbol Server settings for internal usage"))
{
SetInternalSymbolServer $settings $CacheDirectory $symPath
WriteSettingsFile $script:vsVersionArray[$i] $settings
}
}
}
}
}
else
{
if ($CacheDirectory.Length -eq 0)
{
$CacheDirectory = "C:\SYMBOLS\PUBLIC"
}
# It's public so we have a little different processing to do as there are
# two public symbol servers where MSFT provides symbols.
$refSrcPath = "$CacheDirectory*http://referencesource.microsoft.com/symbols"
$msdlPath = "$CacheDirectory*https://msdl.microsoft.com/download/symbols"
$extraPaths = ""
# Poke on any additional symbol servers. I've keeping everything the
# same between VS as WinDBG.
for ($i = 0 ; $i -lt $SymbolServers.Length ; $i++)
{
$extraPaths += "SRV*$CacheDirectory*"
$extraPaths += $SymbolServers[$i]
$extraPaths += ";"
}
$envPath = "$extraPaths" + "SRV*$refSrcPath;SRV*$msdlPath"
if ($CurrentEnvironmentOnly)
{
CreateDirectoryIfNeeded -directory $CacheDirectory
$env:_NT_SYMBOL_PATH = $envPath
}
else
{
Set-ItemPropertyScript HKCU:\Environment _NT_SYMBOL_PATH $envPath
for ($i = 0; $i -lt $script:vsVersionArray.Length; $i++)
{
[xml]$settings = OpenSettingsFile $script:vsVersionArray[$i]
if ($null -ne $settings)
{
if ($PSCmdlet.ShouldProcess("VS "+ $script:vsVersionArray[$i], "Symbol Server settings for public usage"))
{
SetPublicSymbolServer $settings $CacheDirectory $envPath $script:vsVersionArray[$i]
WriteSettingsFile $script:vsVersionArray[$i] $settings
}
}
}
}
}
if ($CurrentEnvironmentOnly)
{
Write-Verbose -Message "`nThe _NT_SYMBOL_PATH environment variable was updated for this window only`n"
}
else
{
Write-Verbose -Message "`nPlease log out to activate the new symbol server settings`n"
}
}
###############################################################################
function Get-SourceServerFiles
{
<#
.SYNOPSIS
Prepopulate your symbol cache with all your Source Server extracted source
code.
.DESCRIPTION
Recurses the specified symbol cache directory for PDB files with Source Server
sections and extracts the source code. This script is a simple wrapper around
SRCTOOl.EXE from the Debugging Tools for Windows (AKA WinDBG). If WinDBG is in
the PATH this script will find SRCTOOL.EXE. If WinDBG is not in your path, use
the SrcTool parameter to specify the complete path to the tool.
.PARAMETER CacheDirectory
The required cache directory for the local machine.
.PARAMETER SrcTool
The optional parameter to specify where SRCTOOL.EXE resides.
.LINK
http://www.wintellect.com/devcenter/author/jrobbins
https://github.com/Wintellect/WintellectPowerShell
#>
# I hate suppressing this warning, but I created this cmdlet long before the
# script analyzer came out. If someone has this in a script, changing the
# cmdlet name will break them.
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Scope="Function")]
param (
[Parameter(Mandatory=$true,
HelpMessage="Please specify the source server directory")]
[string] $CacheDirectory ,
[Parameter(HelpMessage="The optional full path to SCRTOOL.EXE")]
[string] $SrcTool = ""
)
if ($SrcTool -eq "")
{
# Go with the default of looking up WinDBG in the path.
$windbg = Get-Command -Name windbg.exe -ErrorAction SilentlyContinue
if ($null -eq $windbg)
{
throw "Please use the -SrcTool parameter or have WinDBG in the path"
}
$windbgPath = Split-Path -Path ($windbg.Definition)
$SrcTool = $windbgPath + "\SRCSRV\SRCTOOL.EXE"
}
if ($null -eq (Get-Command -Name $SrcTool -ErrorAction SilentlyContinue))
{
throw "SRCTOOL.EXE does not exist."
}
if ((Test-Path -Path $CacheDirectory) -eq $false)
{
throw "The specified cache directory does not exist."
}
# Get all the PDB files, execute SRCTOOL.EXE on each one.
Get-ChildItem -Recurse -Include *.pdb -Path $cacheDirectory | `
ForEach-Object { &$SrcTool -d:$CacheDirectory -x $_.FullName }
}
###############################################################################
function Set-SymbolAndSourceServer
{
<#
.SYNOPSIS
Sets up a computer to use a symbol and source server.
.DESCRIPTION
Sets up both the _NT_SYMBOL_PATH and _NT_SOURCE_PATH environment variable as
well as VS 2012-2017 (for each installed) to use a common symbol and source
cache directory as well as common symbol servers. Optionally can be used to
only set _NT_SYMBOL_PATH and _NT_SOURCE_PATH for an individual PowerShell window.
This is a wrapper around Set-SymbolServer and Set-SourceServer. These have been
a single command anyway.
.PARAMETER Internal
Sets the symbol server to use to http://SymWeb. Visual Studio will not use the
public symbol servers. This will turn off the .NET Framework Source Stepping.
This switch is intended for internal Microsoft use only. You must specify either
-Internal or -Public to the script.
.PARAMETER Public
Sets the symbol server to use as the two public symbol servers from Microsoft.
All the appropriate settings are configured to properly have .NET Reference
Source stepping working.
.PARAMETER CacheDirectory
Defaults to C:\SYMBOLS\PUBLIC for -Public and C:\SYMBOLS\INTERNAL for -Internal.
.PARAMETER SymbolServers
A string array of additional symbol servers to use. If -Internal is set, these
additional symbol servers will appear before HTTP://SYMWEB. If -Public is set,
these symbol servers will appear before the public symbol servers so both the
environment variable and Visual Studio have the same search order.
.PARAMETER CurrentEnvironmentOnly
If specified will only set the current PowerShell window _NT_SYMBOL_PATH
and _NT_SOURCE_PATH environment variable and not overwrite the global
settings. This is primarily for use with WinDBG as Visual Studio requires
settings files for the cache directory and other settings.
.LINK
http://www.wintellect.com/devcenter/author/jrobbins
https://github.com/Wintellect/WintellectPowerShell
#>
[CmdLetBinding(SupportsShouldProcess=$true)]
param ( [switch] $Internal,
[switch] $Public,
[string] $CacheDirectory="",
[string[]] $SymbolServers=@(),
[switch] $CurrentEnvironmentOnly)
# Splatting is just so cool...
Set-SymbolServer @psBoundParameters
if ($CacheDirectory.Length -eq 0)
{
if ($Public)
{
$CacheDirectory = "C:\SYMBOLS\PUBLIC"
}
else
{
$CacheDirectory = "C:\SYMBOLS\INTERNAL"
}
}
Set-SourceServer -CacheDirectory $CacheDirectory
}
# SIG # Begin signature block
# MIIUywYJKoZIhvcNAQcCoIIUvDCCFLgCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUSuGi+KKJWA7wS5bKuvdgdtJB
# aTCggg+6MIIEmTCCA4GgAwIBAgIPFojwOSVeY45pFDkH5jMLMA0GCSqGSIb3DQEB
# BQUAMIGVMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQg
# TGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNV
# BAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTEdMBsGA1UEAxMUVVROLVVTRVJG
# aXJzdC1PYmplY3QwHhcNMTUxMjMxMDAwMDAwWhcNMTkwNzA5MTg0MDM2WjCBhDEL
# MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
# BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKjAoBgNVBAMT
# IUNPTU9ETyBTSEEtMSBUaW1lIFN0YW1waW5nIFNpZ25lcjCCASIwDQYJKoZIhvcN
# AQEBBQADggEPADCCAQoCggEBAOnpPd/XNwjJHjiyUlNCbSLxscQGBGue/YJ0UEN9
# xqC7H075AnEmse9D2IOMSPznD5d6muuc3qajDjscRBh1jnilF2n+SRik4rtcTv6O
# KlR6UPDV9syR55l51955lNeWM/4Og74iv2MWLKPdKBuvPavql9L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