fix: replace deprecated wmic with powershell for printer listing

This commit is contained in:
Joelbrit0 2026-01-21 13:02:46 -03:00
parent e13355ce37
commit 853aeddb75
1 changed files with 2 additions and 2 deletions

View File

@ -11,12 +11,12 @@ export class ListPrinterService {
async listPrinters(): Promise<string[]> { async listPrinters(): Promise<string[]> {
try { try {
const { stdout } = await execAsync( const { stdout } = await execAsync(
'wmic printer get name', 'powershell -Command "Get-Printer | Select-Object -ExpandProperty Name"',
{ encoding: 'utf-8' } { encoding: 'utf-8' }
); );
const printers = stdout const printers = stdout
.split('\n') .split('\r\n')
.map(line => line.trim()) .map(line => line.trim())
.filter(line => line && line !== 'Name'); .filter(line => line && line !== 'Name');