From e0c4d6b56b55272b07e13529e9c4a451e0f9cba7 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 18 Nov 2021 21:34:52 -0800 Subject: [PATCH] wmic is deprecated, use powershell to find out the version of android studio --- packages/cli/src/commands/doctor/healthchecks/androidStudio.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/doctor/healthchecks/androidStudio.ts b/packages/cli/src/commands/doctor/healthchecks/androidStudio.ts index 8c22ec59e..4a7f76923 100644 --- a/packages/cli/src/commands/doctor/healthchecks/androidStudio.ts +++ b/packages/cli/src/commands/doctor/healthchecks/androidStudio.ts @@ -26,8 +26,9 @@ export default { 'bin', 'studio.exe', ).replace(/\\/g, '\\\\'); + const powershell = `${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`; const {stdout} = await executeCommand( - `wmic datafile where name="${androidStudioPath}" get Version`, + `${powershell} -Command "& { (Get-ChildItem \\"${androidStudioPath}\\").VersionInfo.FileVersionRaw.ToString() }"`, ); const version = stdout.replace(/(\r\n|\n|\r)/gm, '').trim();