Skip to content

Commit

Permalink
Merge pull request #854 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.20.1021.1
  • Loading branch information
NikCharlebois authored Oct 21, 2020
2 parents 957cdfe + 2724e0c commit e6210c0
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 12 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change log for Microsoft365DSC

## 1.20.1021.1

* AADTenantDetails
* Fixed issue where IsSingleInstance was not returned from
the Get-TargetResource method;
* MISC
* Fix to how Telemetry is retrieving module version;
* Added additional error troubleshooting information
to telemetry (dependencies version).

## 1.20.1016.1

* Fixed a permissions issue with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ function Get-TargetResource
{
Write-Verbose -Message "Found existing AzureAD Tenant Details"
$result = @{
MarketingNotificationEmails = $AADTenantDetails.MarketingNotificationEmails
SecurityComplianceNotificationMails = $AADTenantDetails.SecurityComplianceNotificationMails
SecurityComplianceNotificationPhones = $AADTenantDetails.SecurityComplianceNotificationPhones
TechnicalNotificationMails = $AADTenantDetails.TechnicalNotificationMails
IsSingleInstance = 'Yes'
MarketingNotificationEmails = $AADTenantDetails.MarketingNotificationEmails
SecurityComplianceNotificationMails = $AADTenantDetails.SecurityComplianceNotificationMails
SecurityComplianceNotificationPhones = $AADTenantDetails.SecurityComplianceNotificationPhones
TechnicalNotificationMails = $AADTenantDetails.TechnicalNotificationMails
GlobalAdminAccount = $GlobalAdminAccount
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DSCHashTabletoString -Hashtable $result)"
return $result
Expand Down
13 changes: 9 additions & 4 deletions Modules/Microsoft365DSC/Microsoft365DSC.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2020-10-16
# Generated on: 2020-10-21

@{

# Script module or binary module file associated with this manifest.
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.20.1016.1'
ModuleVersion = '1.20.1021.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -174,8 +174,13 @@
IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true'

# ReleaseNotes of this module
ReleaseNotes = "* TeamsVoiceRoute
* Initial Release"
ReleaseNotes = "* AADTenantDetails
* Fixed issue where IsSingleInstance was not returned from
the Get-TargetResource method;
* MISC
* Fix to how Telemetry is retrieving module version;
* Added additional error troubleshooting information
to telemetry (dependencies version)."

# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false
Expand Down
11 changes: 10 additions & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ function New-M365DSCLogEntry

[Parameter()]
[System.String]
$Source
$Source,

[Parameter()]
[System.String]
$TenantId
)

try
Expand All @@ -33,6 +37,11 @@ function New-M365DSCLogEntry
$driftedData.Add("CustomMessage", $Message)
$driftedData.Add("Source", $Source)
$driftedData.Add("StackTrace", $Error.ScriptStackTrace)

if ($null -ne $TenantId)
{
$driftedData.Add("TenantId", $TenantId)
}
Add-M365DSCTelemetryEvent -Type "Error" -Data $driftedData
#endregion

Expand Down
21 changes: 20 additions & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,26 @@ function Show-M365DSCGUI
catch
{
$Message = "Could not initiate the ReverseDSC Extraction"
New-M365DSCLogEntry -Error $_ -Message $Message -Source "[M365DSCReverseGUI]"
$tenantId = $null
try
{
if (-not [System.String]::IsNullOrEmpty($txtTenantId.Text))
{
$tenantId = $txtTenantId.Text
}
elseif ($null -ne $GlobalAdminAccount)
{
$tenantId = $GlobalAdminAccount.UserName.Split('@')[1]
}
}
catch
{
Write-Verbose -Message $_
}
New-M365DSCLogEntry -Error $_ `
-Message $Message `
-Source "[M365DSCReverseGUI]" `
-TenantId $tenantId
}
})
$panelMenu.Controls.Add($btnExtract);
Expand Down
23 changes: 21 additions & 2 deletions Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,27 @@ function Add-M365DSCTelemetryEvent
}
}

$version = (Get-Module 'Microsoft365DSC').Version
$Data.Add("M365DSCVersion", $version)
[array]$version = (Get-Module 'Microsoft365DSC').Version | Sort-Object -Descending
$Data.Add("M365DSCVersion", $version[0].ToString())

# Get Dependencies loaded versions
try
{
$currentPath = Join-Path -Path $PSScriptRoot -ChildPath '..\' -Resolve
$manifest = Import-PowerShellDataFile "$currentPath/Microsoft365DSC.psd1"
$dependencies = $manifest.RequiredModules

$dependenciesContent = ""
foreach($dependency in $dependencies)
{
$dependenciesContent += Get-Module $dependency.ModuleName | Out-String
}
$Data.Add("DependenciesVersion", $dependenciesContent)
}
catch
{
Write-Verbose -Message $_
}

$TelemetryClient.TrackEvent($Type, $Data, $Metrics)
$TelemetryClient.Flush()
Expand Down

0 comments on commit e6210c0

Please sign in to comment.