@@ -26,15 +26,17 @@ const LOOKUPS: Record<string, {
2626 }
2727 } ,
2828 pwsh : {
29- cmd : 'powershell ' ,
30- args : [ '-NoProfile' , '-Command' , 'Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine | ConvertTo-Json -Compress' ] ,
29+ cmd : 'pwsh ' ,
30+ args : [ '-NoProfile' , '-Command' , '" Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine | ConvertTo-Json -Compress" ' ] ,
3131 parse ( stdout : string ) {
3232 let arr : any [ ] = [ ]
3333 try {
3434 arr = JSON . parse ( stdout )
3535 } catch {
3636 return [ ]
3737 }
38+ console . log ( 'debug win2025+ data' , arr )
39+
3840 // Reshape into Ingrid-like objects for normalizeOutput
3941 return arr . map ( p => ( {
4042 ProcessId : [ p . ProcessId ] ,
@@ -45,7 +47,7 @@ const LOOKUPS: Record<string, {
4547 } ,
4648}
4749
48- const isBin = ( f : string ) : boolean => {
50+ const isBin = ( f : string ) : boolean => {
4951 if ( f === '' ) return false
5052 if ( ! f . includes ( '/' ) && ! f . includes ( '\\' ) ) return true
5153 if ( f . length > 3 && f [ 0 ] === '"' )
@@ -125,12 +127,15 @@ const _lookup = ({
125127 const { promise, resolve, reject } = pFactory ( )
126128 const result : TPsLookupEntry [ ] = [ ]
127129 const lookupFlow = IS_WIN ? ( IS_WIN2025_PLUS ? 'pwsh' : 'wmic' ) : 'ps'
130+ console . log ( 'debug win2025+' , lookupFlow )
128131 const {
129132 parse,
130133 cmd,
131134 args
132135 } = LOOKUPS [ lookupFlow ]
133- const callback : TSpawnCtx [ 'callback' ] = ( err , { stdout} ) => {
136+ const callback : TSpawnCtx [ 'callback' ] = ( err , { stdout, stderr} ) => {
137+ console . log ( 'stdout=' , stdout . slice ( 0 , 2000 ) )
138+ console . log ( 'stderr=' , stderr )
134139 if ( err ) {
135140 reject ( err )
136141 cb ( err )
0 commit comments