You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

  1. #Purpose: Updates SNI Version
  2. Write-Host "SNI Version to test = 123"
  3. ##Get the shared SNI Version from the downloaded artifact
  4. #$SharedSNIVersion = Get-Content -path "$(Pipeline.Workspace)/SharedSNIVersion.txt"
  5. #Get the SNI Version to test from the user entered version.
  6. $SharedSNIVersion = "123"
  7. # define file to update
  8. $PropsPath = 'C:\Users\mdaigle\SqlClient\tools\props\Versions.props'
  9. type $PropsPath
  10. # new version number to update to
  11. ##Write-Host "SNI Version to test = $(SNIValidationVersion)"
  12. Write-Host "SNI Version to test = $SharedSNIVersion"
  13. # define an xml object
  14. $xml = New-Object XML
  15. # load content of xml from file defined above
  16. $xml.Load($PropsPath)
  17. # define namespace used to read a node
  18. $nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable)
  19. $nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI)
  20. $netFxSniVersion = $xml.SelectSingleNode('//ns:MicrosoftDataSqlClientSniVersion', $nsm)
  21. Write-Host "Node NetFx SNI Version = $($netFxSniVersion.InnerText)"
  22. # update the node inner text
  23. $netFxSniVersion.InnerText = "$SharedSNIVersion"
  24. $netCoreSniVersion = $xml.SelectSingleNode('//ns:MicrosoftDataSqlClientSNIRuntimeVersion', $nsm)
  25. # update the node inner text
  26. $netCoreSniVersion.InnerText = "$SharedSNIVersion"
  27. # save the xml file
  28. $xml.Save($PropsPath)
  29. type $PropsPath