diff --git a/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts b/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts index 7d98b3bb..344c4632 100644 --- a/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts +++ b/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts @@ -86,7 +86,9 @@ Please install the .NET SDK manually by following https://learn.microsoft.com/en return new Promise((resolve, reject) => { // The '.' character is not allowed for sudo-prompt so we use 'NET' - const options = { name: `${this.context?.acquisitionContext?.requestingExtensionId} On behalf of NET Install Tool` }; + let sanitizedCallerName = this.context?.acquisitionContext?.requestingExtensionId?.replace(/[^0-9a-z]/gi, ''); // Remove non-alphanumerics per OS requirements + sanitizedCallerName = sanitizedCallerName?.substring(0, 69); // 70 Characters is the maximum limit we can use for the prompt. + const options = { name: `${sanitizedCallerName ?? '.NET Install Tool'}` }; exec((fullCommandString), options, (error?: any, stdout?: any, stderr?: any) => { let commandResultString = '';