diff --git a/src/WingetCreateCLI/Program.cs b/src/WingetCreateCLI/Program.cs index 16351c4f..27f6573a 100644 --- a/src/WingetCreateCLI/Program.cs +++ b/src/WingetCreateCLI/Program.cs @@ -25,7 +25,6 @@ internal class Program private static async Task Main(string[] args) { Logger.Initialize(); - UserSettings.FirstRunTelemetryConsent(); TelemetryEventListener.EventListener.IsTelemetryEnabled(); SentenceBuilder.Factory = () => new LocalizableSentenceBuilder(); Console.OutputEncoding = System.Text.Encoding.UTF8; @@ -57,7 +56,6 @@ private static async Task Main(string[] args) var parserResult = myParser.ParseArguments(args, types); BaseCommand command = parserResult.MapResult(c => c as BaseCommand, err => null); - if (command == null) { DisplayHelp(parserResult as NotParsed); @@ -65,6 +63,13 @@ private static async Task Main(string[] args) return args.Any() ? 1 : 0; } + if (command is not DscCommand) + { + // For DSC commands, we do not want to display the header to + // ensure the output is a valid JSON. + UserSettings.FirstRunTelemetryConsent(); + } + // If the user has provided a token via the command line, warn them that it may be logged if (!string.IsNullOrEmpty(command.GitHubToken)) { diff --git a/src/WingetCreateCLI/WingetCreateCLI.csproj b/src/WingetCreateCLI/WingetCreateCLI.csproj index 6536b6bb..c43df76f 100644 --- a/src/WingetCreateCLI/WingetCreateCLI.csproj +++ b/src/WingetCreateCLI/WingetCreateCLI.csproj @@ -102,14 +102,6 @@ - - - %(Filename)%(Extension) -    Always -    Always - diff --git a/src/WingetCreatePackage/WingetCreatePackage.wapproj b/src/WingetCreatePackage/WingetCreatePackage.wapproj index 57a3028b..8bcf5f5e 100644 --- a/src/WingetCreatePackage/WingetCreatePackage.wapproj +++ b/src/WingetCreatePackage/WingetCreatePackage.wapproj @@ -51,6 +51,7 @@ +