mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-27 11:56:14 +08:00
Adding missing guard for telemetry optout to avoid NRE when importing modules (#18949)
This commit is contained in:
parent
d29f34b5c2
commit
4e80e7611f
@ -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>
|
/// <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)
|
internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName, string moduleVersion = AnonymousVersion)
|
||||||
{
|
{
|
||||||
|
if (!CanSendTelemetry)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string allowedModuleName = GetModuleName(moduleName);
|
string allowedModuleName = GetModuleName(moduleName);
|
||||||
|
Loading…
Reference in New Issue
Block a user