mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Adding missing guard for telemetry optout to avoid NRE when importing modules (#18949)
This commit is contained in:
committed by
Dongbo Wang
parent
93fa32222e
commit
142b17e699
@@ -661,6 +661,11 @@ namespace Microsoft.PowerShell.Telemetry
|
||||
/// <param name="moduleVersion">The module version to report. The default value is the anonymous version '0.0.0.0'.</param>
|
||||
internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName, string moduleVersion = AnonymousVersion)
|
||||
{
|
||||
if (!CanSendTelemetry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string allowedModuleName = GetModuleName(moduleName);
|
||||
|
||||
Reference in New Issue
Block a user