diff --git a/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 index 2d5ec11bef..7da573cfc1 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 @@ -394,6 +394,9 @@ function New-M365DSCReportFromConfiguration $OutputPath ) + # Validate that the latest version of the module is installed. + Test-M365DSCModuleValidity + #Ensure the proper dependencies are installed in the current environment. Confirm-M365DSCDependencies @@ -830,6 +833,9 @@ function New-M365DSCDeltaReport $Delta ) + # Validate that the latest version of the module is installed. + Test-M365DSCModuleValidity + if ((Test-Path -Path $Source) -eq $false) { Write-Error "Cannot find file specified in parameter Source: $Source. Please make sure the file exists!" diff --git a/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 index fd21bc3e8a..12bbb773d2 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 @@ -3541,14 +3541,6 @@ function Test-M365DSCModuleValidity Write-Host "There is a newer version of the 'Microsoft365DSC' module available on the gallery." Write-Host "To update the module and it's dependencies, run the following commands:" Write-Host "Update-Module -Name 'Microsoft365DSC' -Force`nUpdate-M365DSCDependencies -Force`nUninstall-M365DSCOutdatedDependencies" -ForegroundColor Blue - # if(!( $UpdateConsent = Read-Host -Prompt "Do you wish to update the M365DSC module and it's dependencies? (Y/N) [Default: 'Y']")) { $UpdateConsent = 'Y' } - # if(!( $UpdateConsent -eq 'Y' -or $UpdateConsent -eq 'y' )) { return } - # Write-Host "Updating the M365DSC module..." -ForegroundColor Yellow - # Update-Module -Name 'Microsoft365DSC' -Force - # Write-Host "Updating dependencies..." -ForegroundColor Yellow - #Update-M365DSCDependencies -Force - # Write-Host "uninstalling outdated installations..." -ForegroundColor Yellow - # Uninstall-M365DSCOutdatedDependencies } } Export-ModuleMember -Function @(