Updated PowerShell Script for Setting Your Symbol Paths

Here’s my latest script for setting up a user’s_NT_SYMBOL_PATH environment variable as well as Visual Studio 2010’s symbolsettings. In a previous version of this script, I wasn’t setting the publicsymbol server cache directory in Visual Studio so you could end up with downloadedsymbols in C:SYMBOLSPUBLIC instead ofC:SYMBOLSPUBLICMICROSOFTPUBLICSYMBOLS.

#requires -version 2.0

#Wintellect .NET Debugging Code
#(c) 2009-2010 by John RobbinsWintellect – Do whatever you want to do with it
# aslong as you give credit.

<#.SYNOPSIS
Setsup a computer with symbol server values in both the environment and in
VS 2010.
.DESCRIPTION
Sets up both the _NT_SYMBOL_PATH environment variable and Visual Studio 2010
to use a common symbol cache directory as well as common symbol servers.
.PARAMETER Internal
Sets the symbol server to use to SYMBOLSSYMBOLS. Visual Studio will not use
the public symbol servers. This will turn off the .NET Framework SourceStepping
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:SYMBOLSPUBLICMicrosoftPublicSymbols for -Public and
C:SYMBOLSINTERNAL for -Internal. If you specify a different cache directory
with -Public, MicrosoftPublicSymbols will always be appended. This is to
avoid issues with Visual Studio downloading the symbols to a differentlocation.
.PARAMETER SymbolServers
A string array of additional symbol servers to use. If -Internal is set, these
additional symbol servers will appear after SYMBOLSSYMBOLS. If -Public is
set, these symbol servers will appear after the public symbol servers so both
the environment variable and Visual Studio have the same search order
#>
[CmdLetBinding(SupportsShouldProcess=$true)]
param ( [switch]   $Internal      ,
[switch]   $Public         ,
[string]   $CacheDirectory ,
[string[]] $SymbolServers   )

#Always make sure all variables are defined.
Set-PSDebug -Strict

#Creates the cache directory if it does not exist.
function CreateCacheDirectory ( [string] $cacheDirectory )
{
if ( ! $(Test-path $cacheDirectory -type “Container” ))
{
if ($PSCmdLet.ShouldProcess(“Destination:$cacheDirectory” ,
“CreateDirectory”))
{
New-Item -type directory -Path $cacheDirectory > $null
}
}
}

function Set-ItemPropertyScript ( $path , $name , $value , $type )
{
if ( $path -eq $null )
{
Write-Error “Set-ItemPropertyScriptpath param cannot be null!”
exit
}
if ( $name -eq $null )
{
Write-Error “Set-ItemPropertyScriptname param cannot be null!”
exit
}
$propString = “Item: “ + $path.ToString() + ” Property:” + $name
if ($PSCmdLet.ShouldProcess($propString ,“SetProperty”))
{
if ($type -eq $null)
{
Set-ItemProperty -Path $path -Name $name -Value $value
}
else
{
Set-ItemProperty -Path $path -Name $name -Value $value -Type $type
}
}
}

# Dothe parameter checking.
if ( $Internal -eq $Public )
{
Write-Error “You must specify either -Internal or-Public”
exit
}

#Check if VS is running.
if (Get-Process ‘devenv’ -ErrorAction SilentlyContinue)
{
Write-Error “Visual Studio is running. Pleaseclose all instances before running this script”
exit
}

$dbgRegKey = “HKCU:SoftwareMicrosoftVisualStudio10.0Debugger”

if ( $Internal )
{
if ( $CacheDirectory.Length -eq 0 )
{
$CacheDirectory = “C:SYMBOLSINTERNAL”
}

CreateCacheDirectory $CacheDirectory

# Default to SYMBOLSSYMBOLS and addany additional symbol servers to
# the end of the string.
$symPath = “SRV*$CacheDirectory*SYMBOLSSYMBOLS”
$vsPaths = “”
$pathState = “”

for ( $i = 0 ; $i -lt $SymbolServers.Length ; $i++ )
{
$symPath += “*”
$symPath += $SymbolServers[$i]

$vsPaths += $SymbolServers[$i]
$vsPaths += “;”
$pathState += “1”
}
$symPath += “;”

Set-ItemPropertyScript HKCU:Environment _NT_SYMBOL_PATH $symPath

# Turn off .NET Framework Sourcestepping.
Set-ItemPropertyScript $dbgRegKey FrameworkSourceStepping 0 DWORD
# Turn off using the Microsoft symbolservers.
Set-ItemPropertyScript $dbgRegKey SymbolUseMSSymbolServers 0 DWORD
# Set the symbol cache dir to the samevalue as used in the environment
# variable.
Set-ItemPropertyScript $dbgRegKey SymbolCacheDir $CacheDirectory
# Set the VS symbol path to anyadditional values
Set-ItemPropertyScript $dbgRegKey SymbolPath $vsPaths
# Tell VS that to the additional serversspecified.
Set-ItemPropertyScript $dbgRegKey SymbolPathState $pathState

}
else
{
if ( $CacheDirectory.Length -eq 0 )
{
$CacheDirectory = “C:SYMBOLSPUBLIC”
}

# For -Public, we have to putMicrosoftPublicSymbols on the end because
# Visual Studio hard codes that on forsome reason. I have no idea why.
if ( $CacheDirectory.EndsWith(“”) -eq $false )
{
$CacheDirectory += “”
}
$CacheDirectory += “MicrosoftPublicSymbols”

CreateCacheDirectory $CacheDirectory

# It’s public so we have a littledifferent processing to do. I have to
# add the MicrosoftPublicSymbols as VShardcodes that onto the path.
# This way both WinDBG and VS are usingthe same paths for public
# symbols.
$refSrcPath = “$CacheDirectory*http://referencesource.microsoft.com/symbols”
$msdlPath = “$CacheDirectory*http://msdl.microsoft.com/download/symbols”
$extraPaths = “”
$enabledPDBLocations =“11”

# 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 += “;”
$extraPaths += $SymbolServers[$i]
$enabledPDBLocations += “1”
}

$envPath = “SRV*$refSrcPath;SRV*$msdlPath$extraPaths”

Set-ItemPropertyScript HKCU:Environment _NT_SYMBOL_PATH $envPath

# Turn off Just My Code.
Set-ItemPropertyScript $dbgRegKey JustMyCode 0 DWORD

# Turn on .NET Framework Source stepping.
Set-ItemPropertyScript $dbgRegKey FrameworkSourceStepping 1 DWORD

# Turn on Source Server Support.
Set-ItemPropertyScript $dbgRegKey UseSourceServer 1 DWORD

# Turn on Source Server Diagnostics asthat’s a good thing. 🙂
Set-ItemPropertyScript $dbgRegKey ShowSourceServerDiagnostics 1 DWORD

# It’s very important to turn offrequiring the source to match exactly.
# With this flag on, .NET ReferenceSource Stepping doesn’t work.
Set-ItemPropertyScript $dbgRegKey UseDocumentChecksum 0 DWORD

# Turn on using the Microsoft symbolservers.
Set-ItemPropertyScript $dbgRegKey SymbolUseMSSymbolServers 1 DWORD

# Set the VS SymbolPath setting.
$vsSymPath =“$refSrcPath;$msdlPath$extraPaths”
Set-ItemPropertyScript $dbgRegKey SymbolPath $vsSymPath

# Tell VS that all paths set are active(you see those as check boxes in
# the Options dialog, DebuggingSymbolspage).
Set-ItemPropertyScript $dbgRegKey SymbolPathState $enabledPDBLocations

# Set the symbol cache dir to the samevalue as used in the environment
# variable.
Set-ItemPropertyScript $dbgRegKey SymbolCacheDir $CacheDirectory

}
“”
“Pleaselog out to activate the new symbol server settings”
“”

For the better part of a decade, Atmosera has owned, operated, and offered TYPE-II SSAE 16 compliant data centers to clients who need secure space, power, and cooling to deploy their mission critical applications. We also leverage 21 additional data centers in the U.S. and abroad through strategic alliances. We offer a range of options from racks and full cabinets to secure cages. We also have network connectivity from several service providers.
Clients benefit from multiple hardened layers of security, reliability, and protection, combined with rigorous operational and maintenance procedures. We provide professional services that include remote hands, monitoring, and backup. We operate three data centers in the Portland Metropolitan area: Data Center 1 (DC1) and Data Center 2 (DC2) located in Beaverton, and Data Center 3 (DC3) located downtown Portland.

Physical Specifications

DC2 provides clients an ideal space to deploy their infrastructure and mission critical applications. We offer a safe and secure environment complete with space, power, and cooling with the following features:

  • Over 6,500 square foot
  • Flat stable ground with no known faults, flood plains, wetland or other geological threats
  • Borders a “Low” to “Low-Mid” seismic risk area, based on the composite score of relative slope instability, relative amplification hazard, and relative liquefaction hazard
  • Floor is static dissipative
  • Out of any flight paths
  • Choice of space in shared and private cabinets, in full-height and partial-cabinet increments
  • All full-height and new partial-size cabinets use a perforated door
  • Cabinets are bolted to the concrete foundation for seismic stability
  • Overhead anchored ladders provide additional vertical stability
  • High average power density of 200 kW/sq. ft. (5 kW per cabinet)
  • All critical systems are configured N+1 or better — allows for scheduled maintenance or subsystem outage without affecting service availability

Type-II SSAE 16 Audited and Compliant for Secure Operations

Atmosera’s colocation facilities are Type-II SSAE 16 audited, providing external validation that controls are in place to ensure the highest levels of security and availability. Our Command Center is staffed 24x7x24 to monitor all systems as well as the campus-wide internal and perimeter video surveillance cameras.

Energy-Efficient Design and Technologies

DC2 incorporates innovative technologies and methodologies designed to reduce energy consumption and achieve a Power Usage Effectiveness (PUE) of 1.3 or better. Because of the energy efficiencies gained compared to conventional data center designs, this is the first data center project to qualify for funding through the Oregon Department of Energy’s State Energy Loan Program (SELP). With the help of Energy Trust of Oregon, EasyStreet played a pioneering role in developing the Oregon Department of Energy’s expertise in the area of efficient data center design.

Our Clients Can ‘Go Green’ With No Surcharge

Atmosera procures 100% Portland General Electric Clean Wind℠ power offsets for DC1 and DC2 as well as our headquarters. Although it cost more to build than a conventional facility — and although renewable power will cost us a premium — the efficiencies gained by design means we can provide our services with no “green surcharge” to our clients.

Convenient and Help When You Need It

Our facilities are designed to help you access your equipment when you need to. We also provide convenient space for you to work including a lobby area for equipment preparation with Internet access. Our loading dock is directly adjacent to the data center and we provide escort services while you load and unload your equipment. We offer a range of professional services from “remote hands” and active monitoring to architecture, design, procurement, and installation all tailored to enable faster deployments and flawless ongoing operations. Clients can also select proactive monitoring services for their applications and/or infrastructure using SolarWinds® Orion and our 24x7x365 Command Center.

Mechanical and HVAC

An innovative Indirect Evaporative Cooling (IEC) system from AMAX® is key to efficiency and outstanding PUE. Direct Expansion (DX) packages provide supplemental cooling when required.

  • Chatsworth Products, Inc. (CPI) chimney cabinets are part of the cooling system. They gather hot exhaust air and route it to the roof for processing
  • Rooftop IEC units in an N+1 configuration. Each IEC unit is connected to a shared supply and return trunk, allowing any spare unit to replace any failed unit
  • Overhead duct work distributes cooled air throughout the data center
  • Humidity is controlled with ultrasonic humidifiers operated by the master control system

A 25,000-gallon underground tank collects rainwater from the roof. It is filtered and used by the IEC units to cool the hot air exhausted through the return duct. Reclaimed water is supplemented by city water when necessary. 100% of our city water usage is offset by BEF Water Restoration Certificates.
A highly-sensitive VESDA aspirating smoke detection (ASD) system. Alerts are enunciated in the Command Center and alarms are sent to a third-party alarm company. A gas-free, pre-action sprinkler system provides fire suppression.

Power Infrastructure

  • A/B 225-amp 120/208V isolated ground Starline buses PDUs and circuit breakers
  • Each bus has independent circuit protection
  • Power is stepped down using harmonic mitigating transformers
  • Transformers are powered by Eaton/ Powerware 9395 825 N+1 Uninterruptible Power Supplies (UPSs) using VYCON flywheels as their power source. Each UPS is internally N+1. Each UPS has N+1 flywheels
  • UPSs are powered through a Square-D switchgear platform
  • The switchgear is powered by a dedicated 4 MW PGE utility feed and 480/277 V 2500 kVA transformer and paralleled 600 kVA Kohler diesel generators in an N+1 configuration

Safety/Access Control/Surveillance

DC2 is monitored by Atmosera’s Command Center 7x24x365 including infrastructure power, client branch circuits, temperature and humidity, generators, switchgear, UPSs, cooling plant, and life safety. We follows strict protocols to control and surveil all access:

  • Accessible 24x7x365 for authorized client personnel via electronic card and fingerprint ID which ensures all access is logged
  • Intrusion detection monitoring with internal alarming and external security service
  • Video cameras with 90-day recording archives

Networking and Telecommunications

Atmosera leverages multiple upstream connections, a fully redundant infrastructure, abundant capacity and years of connectivity experience to deliver unsurpassed network reliability. Atmosera is a carrier-neutral facility with multiple providers, including AboveNet, CenturyLink, Level 3, Comcast, Freewire Broadband, Frontier, Integra, LS Networks and Time Warner. We provide high capacity service with lower-cost choices for backup, Disaster Recovery (DR), synchronization, and more. DC2 has a direct fiber path to DC1 and multiple options including:

  • Connectivity to the Pittock building via redundant ring
  • Centralized monitoring tools and SNMP agents with customized thresholds
  • Tailored monitoring for hardware availability, OS/server performance, application and/or site availability and performance

Atmosera is a founding member of the Northwest Access Exchange (NWAX), a regional Internet exchange with a Point of Presence (PoP) at Atmosera. NWAX provides peering and transit services over a gigabit Ethernet fabric, and interconnects nearly 20 major ISP, business and public/education networks, providing the highest possible performance with local peers.

We deliver solutions that accelerate the value of Azure.

Ready to experience the full power of Microsoft Azure?

Start Today

Blog Home

Stay Connected

Upcoming Events

All Events