From f879de469aef6fcb8f8838afc034deff88bcac53 Mon Sep 17 00:00:00 2001 From: John Robbins Date: Wed, 20 Dec 2017 15:28:17 -0500 Subject: [PATCH] Added Source Linking Support, removed forcing set alias --- .vscode/settings.json | 8 +++++ ChangeLog.md | 11 ++++-- Code/Set-Environment.ps1 | 36 ++++++++++---------- Code/SymbolsSource.ps1 | 51 ++++++++++++++++------------ ReadMe.md | 34 +++++++++---------- WintellectPowerShell.psd1 | Bin 24398 -> 24382 bytes about_WintellectPowerShell.help.txt | 4 +-- 7 files changed, 82 insertions(+), 62 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..02305c6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "cSpell.words": [ + "cmdlet", + "cmdlets", + "hashtable", + "sysinternals" + ] +} \ No newline at end of file diff --git a/ChangeLog.md b/ChangeLog.md index e13670e..cd80f25 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,11 +1,16 @@ # Wintellect PowerShell Change Log # ## Version Current +- Added support for the new Source Linking in VS 2017. +- Removed forcing "set" as an alias because it made the installation of the module ugly and confusing. Add the following to your $profile to bring it back: Set-Alias -Name set -Value Set-Environment -Scope Global -Option AllScope +- Fixed some formatting in the read me and a spelling error in the help. + +## 4.0.0.3 - Many thanks to [Sebastian Solnica](https://github.com/lowleveldesign) for fixing an internationalization bug in Import-VisualStudioEnvironment: [Pull request](https://github.com/Wintellect/WintellectPowerShell/pull/9). - Fixed some formatting in this file. ## 4.0.0.2 -- Fixed a bug with Get-SysInternalsSuite where I needed to add the -Force option when expanding the zip file to force extration into a directory with the existing tools files. +- Fixed a bug with Get-SysInternalsSuite where I needed to add the -Force option when expanding the zip file to force extract into a directory with the existing tools files. - Thanks to [bojanrajkovic](https://github.com/bojanrajkovic) as he fixed an issue it Test-Path: [Pull Request](https://github.com/Wintellect/WintellectPowerShell/pull/8). ## 4.0.0.1 @@ -80,14 +85,14 @@ A huge refactor! - Updated Set-SymbolServer, Set-SourceServer, Get-SourceServer, and Remove-IntelliTraceFiles to support VS 2013. ## June 24, 2013 -- Fixed a bug in Import-VisuaStudioEnvironment where I should be looking at the Wow6432Node on x64 dev boxes reported by [RaHe67](https://github.com/RaHe67). Also updated the cmdlet with the official version and name of VS 2013. +- Fixed a bug in Import-VisualStudioEnvironment where I should be looking at the Wow6432Node on x64 dev boxes reported by [RaHe67](https://github.com/RaHe67). Also updated the cmdlet with the official version and name of VS 2013. ## May 20, 2013 - Updated the Set-SymbolServer -public switch to use the same cache on both the reference source and msdl download items. With VS 2012 this works better and helps avoid multiple downloads of various PDB files. Since I no longer use VS 2010, I'm not sure what affect this will have on that version. Also, I turn off using the Microsoft symbol servers as I'm putting them all in the _NT_SYMBOL_PATH environment variable anyway. - Additionally, Set-SymbolServer now puts any specified symbol servers with the -SymbolServers switch at the front of the _NT_SYMBOL_PATH environment variable. This will make symbol downloading faster for those with your own symbol server set up. ## May 9, 2013 -- Added the Set-Environment, Invoke-CmdScript, and Import-VisuaStudioEnvironment cmdlets. +- Added the Set-Environment, Invoke-CmdScript, and Import-VisualStudioEnvironment cmdlets. - The Invoke-CmdScript cmdlet is based off [Lee Holmes'](http://www.leeholmes.com/blog/2006/05/11/nothing-solves-everything-%e2%80%93-powershell-and-other-technologies/) version. - The Set-Environment cmdlet is from [Wes Haggard](http://weblogs.asp.net/whaggard/archive/2007/02/08/powershell-version-of-cmd-set.aspx). To replace the default set alias with the one provided by WintellectPowerShell, execute the following command before importing the module: diff --git a/Code/Set-Environment.ps1 b/Code/Set-Environment.ps1 index 191509d..9b876c5 100644 --- a/Code/Set-Environment.ps1 +++ b/Code/Set-Environment.ps1 @@ -65,13 +65,11 @@ https://github.com/Wintellect/WintellectPowerShell } } -Set-Alias -Name set -Value Set-Environment -Description "WintellectPowerShell alias" -Force -Scope Global -Option AllScope - # SIG # Begin signature block # MIIUywYJKoZIhvcNAQcCoIIUvDCCFLgCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR -# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUA2f29Aba+dOiaEVc0fJ0WY6M -# Mq2ggg+6MIIEmTCCA4GgAwIBAgIPFojwOSVeY45pFDkH5jMLMA0GCSqGSIb3DQEB +# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUJICeRLIVlb/Ms8JUeta7nESw +# T+Kggg+6MIIEmTCCA4GgAwIBAgIPFojwOSVeY45pFDkH5jMLMA0GCSqGSIb3DQEB # BQUAMIGVMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQg # TGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNV # BAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTEdMBsGA1UEAxMUVVROLVVTRVJG @@ -160,23 +158,23 @@ Set-Alias -Name set -Value Set-Environment -Description "WintellectPowerShell al # IExpbWl0ZWQxIzAhBgNVBAMTGkNPTU9ETyBSU0EgQ29kZSBTaWduaW5nIENBAhEA # +CGT8y+uLXmA2UBOFe5VGzAJBgUrDgMCGgUAoHgwGAYKKwYBBAGCNwIBDDEKMAig # AoAAoQKAADAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgEL -# MQ4wDAYKKwYBBAGCNwIBFTAjBgkqhkiG9w0BCQQxFgQUA2omk7JirvC75yE4Y91Y -# zYt/K4EwDQYJKoZIhvcNAQEBBQAEggEAseqAynCIrPh/Pi0aE5dC9EYyeuPfBuUT -# /yCWhyAzI+/mfizh3XmFYk3AFJcHocKpSVRg2pm2nzaDTr8HxOtFD0wu+PGOI2Z6 -# EvdZ8XsP+FbYPVMycPuaSJJQKXjMAW9RVE5Dp+84sEv/c5dbFmhwqPRPenEw23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oZI -# hvcNAQkFMQ8XDTE3MDExMjIzMDcyNVowIwYJKoZIhvcNAQkEMRYEFDYVoX8DwSkS -# sW16UIRdg9dWpd4YMA0GCSqGSIb3DQEBAQUABIIBAMgk50C/2dsgjLkUb18dftKk -# DEWYvZGs26t6WZuqm/8j1ZaR4pACin87MyI8553UtjzGOdDzxi5P6ZGDVHU1Qpj1 -# BmV0jVIKg/G1kiIrxd+jMyNCxfMi3tw2HH95La5BH4aAeE9iEVlyx39Bll0rCqNT -# QxfLMUeHQT96aOaN1nKyoJFicnyIEJ/PV3gjPt2lsnQUJTsj/qzSIUDTQHzSFu9L -# Vel0CohaPG7/FC4EuD1ViUAahBcNoXYQxfDM1G6X0dYtm0FX71sGdpvsc8/sR/FO -# qKRAR5vpL/Q4tcaguAj1F77s+VJh+8wuEfM+xBduEP5CSD/sf63cMaPP94ablVw= +# hvcNAQkFMQ8XDTE3MTIyMDIwMjQ1MlowIwYJKoZIhvcNAQkEMRYEFJZkVLMCZHjj +# pVIk2MdBzZk+Zs+TMA0GCSqGSIb3DQEBAQUABIIBAKsLrQQsVkWYh0gkZ14klu3n +# FRw9j2TZdwd3/B8yBgp9FP/M34v1P0i+TuLPaloVhg7Vz8mx+x7uAK4PhU9qs1Ws +# pwB/QgMFaBoJvyEf2I76nwsqaeO2GS8cxbHUjtosIG2yoN5Pl9a2wnVxJAzJi+SU +# CGXDHUKdXuDDyk0+TMEOej0QEnF88bT4mSK6Jl6cfKX4yiFFBQOwjFR7qlOLxgxD +# UDldnmV0Hl/Cl3N7oYQjVX069X+Kp94kWKxEe8sEIzHUK4TiwkCw4bhiCdS2O4B4 +# Xh+2DjHBWAw5eYOud1PWLEagNIs8HTh1RygHCawfTApyyg5bxdNdQVhD7odVzgM= # SIG # End signature block diff --git a/Code/SymbolsSource.ps1 b/Code/SymbolsSource.ps1 index 5e61940..05dd5ff 100644 --- a/Code/SymbolsSource.ps1 +++ b/Code/SymbolsSource.ps1 @@ -132,7 +132,7 @@ function Set-ItemPropertyScript $cacheDir.Node.InnerText = $CacheDirectory } - function SetPublicSymbolServer([xml]$settings, $cacheDirectory, $symPath) + function SetPublicSymbolServer([xml]$settings, $cacheDirectory, $symPath, $vsVersion) { CreateDirectoryIfNeeded -directory $CacheDirectory @@ -182,6 +182,14 @@ function Set-ItemPropertyScript $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" + } } ############################################################################### @@ -344,7 +352,8 @@ This switch is intended for internal Microsoft use only. You must specify either .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. +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. @@ -358,7 +367,7 @@ 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 registry settings for the +for use with WinDBG as Visual Studio requires settings files for the cache directory. .LINK @@ -470,7 +479,7 @@ https://github.com/Wintellect/WintellectPowerShell { if ($PSCmdlet.ShouldProcess("VS "+ $script:vsVersionArray[$i], "Symbol Server settings for public usage")) { - SetPublicSymbolServer $settings $CacheDirectory $envPath + SetPublicSymbolServer $settings $CacheDirectory $envPath $script:vsVersionArray[$i] WriteSettingsFile $script:vsVersionArray[$i] $settings } @@ -632,8 +641,8 @@ https://github.com/Wintellect/WintellectPowerShell # SIG # Begin signature block # MIIUywYJKoZIhvcNAQcCoIIUvDCCFLgCA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8XDTE3MDExMjIzMDczNFowIwYJKoZIhvcNAQkEMRYEFPpbnjG9ZVxJ -# sV69QVROGoFwUybHMA0GCSqGSIb3DQEBAQUABIIBAH+Pmoye1dzvJuT32HlR1ZvP -# Kd5NTMb9aFDps1+lzRCvZx+zkK8jX9CAPuTkxbg6SXy/QsWomO7J3YI0yL2doweH -# fWoMp7BrkboLtnJSsDsnO4o60ZXCV4svo1nAD5FyXckgoAyBdI3wv14Zk5BdI3xJ -# VIWtPrJLsJ+JMTYRBddEOiUw2y+sSHCxOYQTCt7xrLYzImkDuaFkxr9bcvfosx6r -# GyTMcL35xLLC91LjeLWzMx7BEjqkspP8z5T/hq6xLDDzSnvA7xsi41cN5MtBlEyL -# Uxn+lSXH7nS20knS1qjkcwz8/pQNPetAroHkLokMmJWKdIMwnsmeWjBwjkrXyfI= +# hvcNAQkFMQ8XDTE3MTIyMDIwMjUwMVowIwYJKoZIhvcNAQkEMRYEFOC4JDfKoI52 +# RchFiM735/M70X5AMA0GCSqGSIb3DQEBAQUABIIBACraObHBWueI84hEe6WvAwSw +# LcsvXSrHBlnmrFsvJf0YMgCAonG6NUrPaIiWAiNy901/rf4Pn/4kadmfG/o79tZI +# tHaMUXP0nLJLm11QapFeZ0JHLj3Z7KrZLHeQSYnCACGwwnllZ+bqjrwT0KcZahf1 +# yJW6YI6pUilley9TtEkpaSx/Qp5HKGzzESuf7o0+dnxce6Tr5w2PMgjjV9t9L2YP +# rq+f9koTCha71sEbT2aFmRigMyyXg+aUfqUwxXjJB/PC6cAPLUHPZAhc8OXeVW+u +# Z3em63Z44Zw8N9X1/KNult8fzlEoNHfmdNAeDZIpa0czTkXsCKNtssQbAsHQX7s= # SIG # End signature block diff --git a/ReadMe.md b/ReadMe.md index 7121666..d30bfb8 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -18,29 +18,29 @@ Here's the about text showing all cmdlets. Of course, all cmdlets have detailed functionality related to debugging and performance tuning. LONG DESCRIPTION - This module makes setting up symbol servers and source server debugging - functionality easier to control for Visual Studio 2013 through 2017 - and WinDBG. Setting up a development machine for symbol server - access is more difficult than it needs to be but no more. + This module makes setting up symbol servers and source server debugging + functionality easier to control for Visual Studio 2013 through 2017 + and WinDBG. Setting up a development machine for symbol server + access is more difficult than it needs to be but no more. - You can have any combination of Visual Studio 2013 through 2017, and - WinDBG on the computer for these cmdlets to work. + You can have any combination of Visual Studio 2013 through 2017, and + WinDBG on the computer for these cmdlets to work. - These cmdlets had been originally developed as PowerShell scripts by John - Robbins and released on his blog. This module combines all the seperate - scripts to make everything easier to manage. + These cmdlets had been originally developed as PowerShell scripts by John + Robbins and released on his blog. This module combines all the separate + scripts to make everything easier to manage. - If you have any questions, suggestions, or bug reports, please contact John - at john@wintellect.com. + If you have any questions, suggestions, or bug reports, please contact John + at john@wintellect.com. - The following cmdlets are included. + The following cmdlets are included. Cmdlet Description ------------------ ---------------------------------------------- - Set-SymbolAndSourceServer Sets up a computer to use a symbol and source - server. (Combines Set-SymbolServer and - Set-Source Server) + Set-SymbolAndSourceServer Sets up a computer to use a symbol and source + server. (Combines Set-SymbolServer and + Set-Source Server) Set-SymbolServer Sets up a computer to use a symbol server. @@ -82,12 +82,12 @@ Here's the about text showing all cmdlets. Of course, all cmdlets have detailed environment variables set in the script to the current PowerShell instance. - Import-VisuaStudioEnvironment Executes the specified Visual Studio + Import-VisualStudioEnvironment Executes the specified Visual Studio VCVARSALL.BAT file importing the environment variables into PowerShell for command line usage. - Set-Signatures Makes digitally signing files a lot easier by + Set-Signatures Makes digitally signing files a lot easier by looking for the first non-Azure code signing file and picking the timestamp server. diff --git a/WintellectPowerShell.psd1 b/WintellectPowerShell.psd1 index 595f2c23df7d2f1ecfe27a58b6158a0f753783c7..71e8686ed0540396a1ccdb4673f67468231f6806 100644 GIT binary patch delta 35 rcmX@Nk8$5V#tm6atcDDF3