Skip to content

Commit

Permalink
Moving Version tag to metadata object (#65)
Browse files Browse the repository at this point in the history
- Moved version tag to metadata object
- Disabled server certificate validation for Test-AdfsServerToken
  • Loading branch information
madhavpatel6 authored Mar 12, 2019
1 parent f2fc470 commit 43bdd87
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Binary file modified ADFSToolbox.psd1
Binary file not shown.
2 changes: 1 addition & 1 deletion ADFSToolbox.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Copyright (c) Microsoft Corporation. All rights reserved.
#>

New-Variable -Name ModuleVersion -Value "1.0.11"
New-Variable -Name ModuleVersion -Value "1.0.12"

$url = "https://api.github.com/repos/Microsoft/adfsToolbox/releases/latest"
$oldProtocol = [Net.ServicePointManager]::SecurityProtocol
Expand Down
10 changes: 7 additions & 3 deletions diagnosticsModule/Private/HelperUtilities.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,15 @@ function GenerateDiagnosticData()

# create aggregate object to store diagnostic output from each cmdlet run
$diagnosticData = New-Object -TypeName PSObject
$testAdfsServerHealth = New-Object -TypeName PSObject
$testAdfsServerHealth = New-Object -TypeName PSObject

# Add ADFS configuration information to the diagnostics json
$adfsConfiguration = New-Object -TypeName PSObject
$adfsConfiguration = AdfsConfiguration
$metadata = New-Object -TypeName PSObject
$metadata | Add-Member -MemberType NoteProperty -Name 'Run Id' -Value (New-Guid).Guid
$metadata | Add-Member -MemberType NoteProperty -Name 'Timestamp' -Value (Get-Date).ToUniversalTime()
$metadata | Add-Member -MemberType NoteProperty -Name 'Version' -Value $outputVersion

foreach($module in $modules.keys)
{
Expand Down Expand Up @@ -723,8 +727,8 @@ function GenerateDiagnosticData()
# add the AD FS Configuration information to the output
Add-Member -InputObject $moduleData -MemberType NoteProperty -Name "Adfs-Configuration" -Value $adfsConfiguration

# add the cmdlet version to the output
Add-Member -InputObject $diagnosticData -MemberType NoteProperty -Name "Version" -Value $outputVersion
# add metadata
Add-Member -InputObject $moduleData -MemberType NoteProperty -Name "Metadata" -Value $metadata

return $diagnosticData
}
Expand Down
4 changes: 4 additions & 0 deletions diagnosticsModule/Public/Test-AdfsServerToken.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Function Test-AdfsServerToken

$rst = $null
$endpoint = $null
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

if ($credential -ne $null)
{
Expand Down Expand Up @@ -129,5 +130,8 @@ Function Test-AdfsServerToken

[Net.ServicePointManager]::SecurityProtocol = $oldProtocol
$tokenXml = [xml]$webresp.Content

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = $null;

return $tokenXml.OuterXml
}

0 comments on commit 43bdd87

Please sign in to comment.