mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Use PowerShell to get windows drive paths.
wmic has been deprecated on newer versions of Windows 11 and is not installed. resolves #4531
This commit is contained in:
		
							parent
							
								
									a5fb0d9cdb
								
							
						
					
					
						commit
						cae1560344
					
				| @ -476,7 +476,7 @@ module.exports.getWindowsDrives = async () => { | ||||
|     return [] | ||||
|   } | ||||
|   return new Promise((resolve, reject) => { | ||||
|     exec('wmic logicaldisk get name', async (error, stdout, stderr) => { | ||||
|     exec('powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"', async (error, stdout, stderr) => { | ||||
|       if (error) { | ||||
|         reject(error) | ||||
|         return | ||||
| @ -485,10 +485,9 @@ module.exports.getWindowsDrives = async () => { | ||||
|         ?.split(/\r?\n/) | ||||
|         .map((line) => line.trim()) | ||||
|         .filter((line) => line) | ||||
|         .slice(1) | ||||
|       const validDrives = [] | ||||
|       for (const drive of drives) { | ||||
|         let drivepath = drive + '/' | ||||
|         let drivepath = drive + ':/' | ||||
|         if (await fs.pathExists(drivepath)) { | ||||
|           validDrives.push(drivepath) | ||||
|         } else { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user