diff --git a/src/WingetCreateCLI/Commands/NewCommand.cs b/src/WingetCreateCLI/Commands/NewCommand.cs index 9634f204..d8ed5578 100644 --- a/src/WingetCreateCLI/Commands/NewCommand.cs +++ b/src/WingetCreateCLI/Commands/NewCommand.cs @@ -457,21 +457,18 @@ private static void PromptForPortableAliasIfApplicable(Installer installer) if (!string.IsNullOrEmpty(portableCommandAlias)) { - List portableCommands = new List { portableCommandAlias }; + List portableCommands = new List { portableCommandAlias.Trim() }; installer.Commands = portableCommands; } } if (installer.NestedInstallerType == NestedInstallerType.Portable) { - foreach (NestedInstallerFile nestedInstallerFile in installer.NestedInstallerFiles) - { - string portableCommandAlias = Prompt.Input(Resources.PortableCommandAlias_Message); + string portableCommandAlias = Prompt.Input(Resources.PortableCommandAlias_Message); - if (!string.IsNullOrEmpty(portableCommandAlias)) - { - nestedInstallerFile.PortableCommandAlias = portableCommandAlias; - } + if (!string.IsNullOrEmpty(portableCommandAlias)) + { + installer.NestedInstallerFiles.First().PortableCommandAlias = portableCommandAlias.Trim(); } } }