如何使用 powershell 确定隐身 chrome 标签的 PID?

如何使用 powershell 确定隐身 chrome 标签的 PID?

按照本网站在命令行中以隐身模式启动 chome 的方法是

&“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”-隐身

(已编辑以在 powershell 中工作)

我可以使用一行代码获取所有 chrome 进程 Pid 和命令行的列表:

Get-CimInstance Win32_Process -Filter “name = 'chrome.exe'”| 选择 ProcessId,CommandLine| fl *|clip

但是,无论是通过 Ctrl+Shift+N 还是命令行启动的隐身进程都没有该命令行参数:

ProcessId   : 29600
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --flag-switches-begin --flag-switches-end

ProcessId   : 12588
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=crashpad-handler 
              "--user-data-dir=C:\Users\justin.dearing\AppData\Local\Google\Chrome\User Data" /prefetch:7 
              --monitor-self-annotation=ptype=crashpad-handler 
              "--database=C:\Users\justin.dearing\AppData\Local\Google\Chrome\User Data\Crashpad" 
              "--metrics-dir=C:\Users\justin.dearing\AppData\Local\Google\Chrome\User Data" 
              --url=https://clients2.google.com/cr/report --annotation=channel= --annotation=plat=Win64 
              --annotation=prod=Chrome --annotation=ver=63.0.3239.132 
              --initial-client-data=0x1e4,0x1e8,0x1ec,0x1e0,0x1f0,0x7ffb01b85720,0x7ffb01b85760,0x7ffb01b85738

ProcessId   : 30604
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=watcher --main-thread-id=23004 
              --on-initialized-event-handle=616 --parent-handle=620 /prefetch:6

ProcessId   : 29940
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=gpu-process 
              --field-trial-handle=1456,10619170367124795314,15493821474693019085,131072 --gpu-vendor-id=0x8086 
              --gpu-device-id=0x193a --gpu-driver-vendor="Intel Corporation" --gpu-driver-version=22.20.16.4749 
              --gpu-driver-date=7-24-2017 --gpu-secondary-vendor-ids=0x102b --gpu-secondary-device-ids=0x0533 
              --service-request-channel-token=2E7DF9AEE477D14FE59C25335C71A2CC --mojo-platform-channel-handle=1560 
              --ignored=" --type=renderer " /prefetch:2

ProcessId   : 35036
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=utility 
              --field-trial-handle=1456,10619170367124795314,15493821474693019085,131072 --lang=en-US 
              --service-sandbox-type=utility --service-request-channel-token=EA3B8A022A6691EC43DEF92EA41799E3 
              --mojo-platform-channel-handle=3796 --ignored=" --type=renderer " /prefetch:8

ProcessId   : 9688
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --no-first-run --no-default-browser-check  
              "data:text/html;charset=utf-8,%3Chead%3E%3C/head%3E%3Cbody%3E%3Cstyle%3Ebody%7Bmargin:25px;font:16px%20ca
              libri,'segoe%20ui'%7D%3C/style%3E%3Ch3%3EChrome%20script%20debugging%20in%20Visual%20Studio%20is%20enable
              d%3C/h3%3E%3Cul%3E%3Cli%3ESet%20breakpoints%20in%20JavaScript/TypeScript%20in%20Visual%20Studio%3C/li%3E%
              3Cli%3EAutomatically%20break%20on%20script%20errors%3C/li%3E%3Cli%3EOpening%20developer%20tools%20in%20Ch
              rome%20stops%20the%20script%20debugging%20session%3C/li%3E%3C/ul%3E%3Ca%20href='https://aka.ms/chromedebu
              gging'%20target='_blank'%3ELearn%20more%20about%20Chrome%20debugging%20in%20Visual%20Studio%3C/a%3E%3Ch4%
              3E%3Ci%3EYour%20application%20is%20starting...%3C/i%3E%3C/h4%3E%3C/body%3E%3C!--a43b36c9-654f-4ac6-a825-8
              6dab529cb46--%3E"  --remote-debugging-port=64275 "--user-data-dir=C:\Users\justin.dearing\AppData\Local\M
              icrosoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_D97D9A83-D0C1-4583-B7FA-995316F620C4
              "

ProcessId   : 38284
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=crashpad-handler --user-data-dir=C:\
              Users\justin.dearing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_
              D97D9A83-D0C1-4583-B7FA-995316F620C4 /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --datab
              ase=C:\Users\justin.dearing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1
              BEBFE6_D97D9A83-D0C1-4583-B7FA-995316F620C4\Crashpad --metrics-dir=C:\Users\justin.dearing\AppData\Local\
              Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_D97D9A83-D0C1-4583-B7FA-995316F620C
              4 --url=https://clients2.google.com/cr/report --annotation=channel= --annotation=plat=Win64 
              --annotation=prod=Chrome --annotation=ver=63.0.3239.132 
              --initial-client-data=0x1e0,0x1e4,0x1e8,0x1dc,0x1ec,0x7ffb01b85720,0x7ffb01b85760,0x7ffb01b85738

ProcessId   : 24784
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=watcher --main-thread-id=30348 
              --on-initialized-event-handle=648 --parent-handle=652 /prefetch:6

ProcessId   : 20216
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=gpu-process 
              --field-trial-handle=1476,13650494111419134215,3798386338761244993,131072 --user-data-dir="C:\Users\justi
              n.dearing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_D97D9A83-D0
              C1-4583-B7FA-995316F620C4" --gpu-vendor-id=0x8086 --gpu-device-id=0x193a --gpu-driver-vendor="Intel 
              Corporation" --gpu-driver-version=22.20.16.4749 --gpu-driver-date=7-24-2017 
              --gpu-secondary-vendor-ids=0x102b --gpu-secondary-device-ids=0x0533 --user-data-dir="C:\Users\justin.dear
              ing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_D97D9A83-D0C1-458
              3-B7FA-995316F620C4" --service-request-channel-token=82E278E4387AD1A0720CEC16AF70DC34 
              --mojo-platform-channel-handle=1496 --ignored=" --type=renderer " /prefetch:2

ProcessId   : 10876
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer 
              --field-trial-handle=1476,13650494111419134215,3798386338761244993,131072 
              --service-pipe-token=ADD9924CCB03D545CC0E0AA6AAF8683D --lang=en-US --user-data-dir="C:\Users\justin.deari
              ng\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_D97D9A83-D0C1-4583
              -B7FA-995316F620C4" --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --blink-settin
              gs=disallowFetchForDocWrittenScriptsInMainFrame=false,disallowFetchForDocWrittenScriptsInMainFrameOnSlowC
              onnections=true --enable-pinch --device-scale-factor=1 --num-raster-threads=4 
              --enable-main-frame-before-activation --enable-gpu-async-worker-context --content-image-texture-target=0,
              0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,35
              53;0,12,3553;0,13,3553;0,14,3553;0,15,3553;0,16,3553;0,17,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,35
              53;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,35
              53;1,16,3553;1,17,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2
              ,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;2,16,3553;2,17,3553;3,0,3553;3,1,3553
              ;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,
              13,3553;3,14,3553;3,15,3553;3,16,3553;3,17,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6
              ,3553;4,7,3553;4,8,3553;4,9,3553;4,10,3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553;4,
              17,3553;5,0,3553;5,1,3553;5,2,3553;5,3,3553;5,4,3553;5,5,3553;5,6,3553;5,7,3553;5,8,3553;5,9,3553;5,10,35
              53;5,11,3553;5,12,3553;5,13,3553;5,14,3553;5,15,3553;5,16,3553;5,17,3553;6,0,3553;6,1,3553;6,2,3553;6,3,3
              553;6,4,3553;6,5,3553;6,6,3553;6,7,3553;6,8,3553;6,9,3553;6,10,3553;6,11,3553;6,12,3553;6,13,3553;6,14,35
              53;6,15,3553;6,16,3553;6,17,3553 --service-request-channel-token=ADD9924CCB03D545CC0E0AA6AAF8683D 
              --renderer-client-id=4 --mojo-platform-channel-handle=2696 /prefetch:1

ProcessId   : 17564
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=utility 
              --field-trial-handle=1476,13650494111419134215,3798386338761244993,131072 --lang=en-US 
              --service-sandbox-type=utility --user-data-dir="C:\Users\justin.dearing\AppData\Local\Microsoft\VisualStu
              dio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_D97D9A83-D0C1-4583-B7FA-995316F620C4" 
              --service-request-channel-token=ADFC87A17EA167684C81F26EC064A7D5 --mojo-platform-channel-handle=3620 
              --ignored=" --type=renderer " /prefetch:8

ProcessId   : 39788
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --no-first-run --no-default-browser-check  
              "data:text/html;charset=utf-8,%3Chead%3E%3C/head%3E%3Cbody%3E%3Cstyle%3Ebody%7Bmargin:25px;font:16px%20ca
              libri,'segoe%20ui'%7D%3C/style%3E%3Ch3%3EChrome%20script%20debugging%20in%20Visual%20Studio%20is%20enable
              d%3C/h3%3E%3Cul%3E%3Cli%3ESet%20breakpoints%20in%20JavaScript/TypeScript%20in%20Visual%20Studio%3C/li%3E%
              3Cli%3EAutomatically%20break%20on%20script%20errors%3C/li%3E%3Cli%3EOpening%20developer%20tools%20in%20Ch
              rome%20stops%20the%20script%20debugging%20session%3C/li%3E%3C/ul%3E%3Ca%20href='https://aka.ms/chromedebu
              gging'%20target='_blank'%3ELearn%20more%20about%20Chrome%20debugging%20in%20Visual%20Studio%3C/a%3E%3Ch4%
              3E%3Ci%3EYour%20application%20is%20starting...%3C/i%3E%3C/h4%3E%3C/body%3E%3C!--0b9eee99-1dba-447e-844c-2
              a8cd0109b81--%3E"  --remote-debugging-port=64341 "--user-data-dir=C:\Users\justin.dearing\AppData\Local\M
              icrosoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_4EE129EE-51D5-41C6-9273-B23F70292D3A
              "

ProcessId   : 35380
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=crashpad-handler --user-data-dir=C:\
              Users\justin.dearing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_
              4EE129EE-51D5-41C6-9273-B23F70292D3A /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --datab
              ase=C:\Users\justin.dearing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1
              BEBFE6_4EE129EE-51D5-41C6-9273-B23F70292D3A\Crashpad --metrics-dir=C:\Users\justin.dearing\AppData\Local\
              Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_4EE129EE-51D5-41C6-9273-B23F70292D3
              A --url=https://clients2.google.com/cr/report --annotation=channel= --annotation=plat=Win64 
              --annotation=prod=Chrome --annotation=ver=63.0.3239.132 
              --initial-client-data=0x1e0,0x1e4,0x1e8,0x1dc,0x1ec,0x7ffb01b85720,0x7ffb01b85760,0x7ffb01b85738

ProcessId   : 17104
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=watcher --main-thread-id=5852 
              --on-initialized-event-handle=644 --parent-handle=648 /prefetch:6

ProcessId   : 17968
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=gpu-process 
              --field-trial-handle=1428,3065080944718534067,580319802844548307,131072 --user-data-dir="C:\Users\justin.
              dearing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_4EE129EE-51D5
              -41C6-9273-B23F70292D3A" --gpu-vendor-id=0x8086 --gpu-device-id=0x193a --gpu-driver-vendor="Intel 
              Corporation" --gpu-driver-version=22.20.16.4749 --gpu-driver-date=7-24-2017 
              --gpu-secondary-vendor-ids=0x102b --gpu-secondary-device-ids=0x0533 --user-data-dir="C:\Users\justin.dear
              ing\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_4EE129EE-51D5-41C
              6-9273-B23F70292D3A" --service-request-channel-token=737996187C3544E7EBA58E9ACA801A7B 
              --mojo-platform-channel-handle=1468 --ignored=" --type=renderer " /prefetch:2

ProcessId   : 29440
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer 
              --field-trial-handle=1428,3065080944718534067,580319802844548307,131072 
              --service-pipe-token=2E60CA09D9FE788066331C313DD6EA18 --lang=en-US --user-data-dir="C:\Users\justin.deari
              ng\AppData\Local\Microsoft\VisualStudio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_4EE129EE-51D5-41C6
              -9273-B23F70292D3A" --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --blink-settin
              gs=disallowFetchForDocWrittenScriptsInMainFrame=false,disallowFetchForDocWrittenScriptsInMainFrameOnSlowC
              onnections=true --enable-pinch --device-scale-factor=1 --num-raster-threads=4 
              --enable-main-frame-before-activation --enable-gpu-async-worker-context --content-image-texture-target=0,
              0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,35
              53;0,12,3553;0,13,3553;0,14,3553;0,15,3553;0,16,3553;0,17,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,35
              53;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,35
              53;1,16,3553;1,17,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2
              ,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;2,16,3553;2,17,3553;3,0,3553;3,1,3553
              ;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,
              13,3553;3,14,3553;3,15,3553;3,16,3553;3,17,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6
              ,3553;4,7,3553;4,8,3553;4,9,3553;4,10,3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553;4,
              17,3553;5,0,3553;5,1,3553;5,2,3553;5,3,3553;5,4,3553;5,5,3553;5,6,3553;5,7,3553;5,8,3553;5,9,3553;5,10,35
              53;5,11,3553;5,12,3553;5,13,3553;5,14,3553;5,15,3553;5,16,3553;5,17,3553;6,0,3553;6,1,3553;6,2,3553;6,3,3
              553;6,4,3553;6,5,3553;6,6,3553;6,7,3553;6,8,3553;6,9,3553;6,10,3553;6,11,3553;6,12,3553;6,13,3553;6,14,35
              53;6,15,3553;6,16,3553;6,17,3553 --service-request-channel-token=2E60CA09D9FE788066331C313DD6EA18 
              --renderer-client-id=4 --mojo-platform-channel-handle=2724 /prefetch:1

ProcessId   : 15084
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=utility 
              --field-trial-handle=1428,3065080944718534067,580319802844548307,131072 --lang=en-US 
              --service-sandbox-type=utility --user-data-dir="C:\Users\justin.dearing\AppData\Local\Microsoft\VisualStu
              dio\15.0_cf8b40b5\WebTools\ChromeUserData_B1BEBFE6_4EE129EE-51D5-41C6-9273-B23F70292D3A" 
              --service-request-channel-token=3D0651C7E9966DF2088619EA6609F4F0 --mojo-platform-channel-handle=3588 
              --ignored=" --type=renderer " /prefetch:8

ProcessId   : 35200
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer 
              --field-trial-handle=1456,10619170367124795314,15493821474693019085,131072 --disable-databases 
              --service-pipe-token=382A3E80A979F18173360DD969037F1D --lang=en-US --enable-offline-auto-reload 
              --enable-offline-auto-reload-visible-only --blink-settings=disallowFetchForDocWrittenScriptsInMainFrame=f
              alse,disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections=true --enable-pinch 
              --device-scale-factor=1 --num-raster-threads=4 --enable-main-frame-before-activation 
              --enable-gpu-async-worker-context --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,
              3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,
              3553;0,16,3553;0,17,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553
              ;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;1,16,3553;1,17,3553;2,0,3553;2,1,35
              53;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;
              2,13,3553;2,14,3553;2,15,3553;2,16,3553;2,17,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3
              ,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553;3,16,3553;
              3,17,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6,3553;4,7,3553;4,8,3553;4,9,3553;4,10,
              3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553;4,17,3553;5,0,3553;5,1,3553;5,2,3553;5,3
              ,3553;5,4,3553;5,5,3553;5,6,3553;5,7,3553;5,8,3553;5,9,3553;5,10,3553;5,11,3553;5,12,3553;5,13,3553;5,14,
              3553;5,15,3553;5,16,3553;5,17,3553;6,0,3553;6,1,3553;6,2,3553;6,3,3553;6,4,3553;6,5,3553;6,6,3553;6,7,355
              3;6,8,3553;6,9,3553;6,10,3553;6,11,3553;6,12,3553;6,13,3553;6,14,3553;6,15,3553;6,16,3553;6,17,3553 
              --service-request-channel-token=382A3E80A979F18173360DD969037F1D --renderer-client-id=25 
              --mojo-platform-channel-handle=7584 /prefetch:1

ProcessId   : 23792
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer 
              --field-trial-handle=1456,10619170367124795314,15493821474693019085,131072 --disable-databases 
              --service-pipe-token=156F3EF64699A601618498BF9C88211E --lang=en-US --enable-offline-auto-reload 
              --enable-offline-auto-reload-visible-only --blink-settings=disallowFetchForDocWrittenScriptsInMainFrame=f
              alse,disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections=true --enable-pinch 
              --device-scale-factor=1 --num-raster-threads=4 --enable-main-frame-before-activation 
              --enable-gpu-async-worker-context --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,
              3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,
              3553;0,16,3553;0,17,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553
              ;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;1,16,3553;1,17,3553;2,0,3553;2,1,35
              53;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;
              2,13,3553;2,14,3553;2,15,3553;2,16,3553;2,17,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3
              ,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553;3,16,3553;
              3,17,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6,3553;4,7,3553;4,8,3553;4,9,3553;4,10,
              3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553;4,17,3553;5,0,3553;5,1,3553;5,2,3553;5,3
              ,3553;5,4,3553;5,5,3553;5,6,3553;5,7,3553;5,8,3553;5,9,3553;5,10,3553;5,11,3553;5,12,3553;5,13,3553;5,14,
              3553;5,15,3553;5,16,3553;5,17,3553;6,0,3553;6,1,3553;6,2,3553;6,3,3553;6,4,3553;6,5,3553;6,6,3553;6,7,355
              3;6,8,3553;6,9,3553;6,10,3553;6,11,3553;6,12,3553;6,13,3553;6,14,3553;6,15,3553;6,16,3553;6,17,3553 
              --service-request-channel-token=156F3EF64699A601618498BF9C88211E --renderer-client-id=31 
              --mojo-platform-channel-handle=10212 /prefetch:1

ProcessId   : 20260
CommandLine : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer 
              --field-trial-handle=1456,10619170367124795314,15493821474693019085,131072 --disable-databases 
              --service-pipe-token=532ED875E6F370AE47E11790881E9553 --lang=en-US --enable-offline-auto-reload 
              --enable-offline-auto-reload-visible-only --blink-settings=disallowFetchForDocWrittenScriptsInMainFrame=f
              alse,disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections=true --enable-pinch 
              --device-scale-factor=1 --num-raster-threads=4 --enable-main-frame-before-activation 
              --enable-gpu-async-worker-context --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,
              3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,
              3553;0,16,3553;0,17,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553
              ;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;1,16,3553;1,17,3553;2,0,3553;2,1,35
              53;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;
              2,13,3553;2,14,3553;2,15,3553;2,16,3553;2,17,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3
              ,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553;3,16,3553;
              3,17,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6,3553;4,7,3553;4,8,3553;4,9,3553;4,10,
              3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553;4,17,3553;5,0,3553;5,1,3553;5,2,3553;5,3
              ,3553;5,4,3553;5,5,3553;5,6,3553;5,7,3553;5,8,3553;5,9,3553;5,10,3553;5,11,3553;5,12,3553;5,13,3553;5,14,
              3553;5,15,3553;5,16,3553;5,17,3553;6,0,3553;6,1,3553;6,2,3553;6,3,3553;6,4,3553;6,5,3553;6,6,3553;6,7,355
              3;6,8,3553;6,9,3553;6,10,3553;6,11,3553;6,12,3553;6,13,3553;6,14,3553;6,15,3553;6,16,3553;6,17,3553 
              --service-request-channel-token=532ED875E6F370AE47E11790881E9553 --renderer-client-id=32 
              --mojo-platform-channel-handle=9832 /prefetch:1

有没有一种简单的方法可以知道要杀死哪个 Pid 才​​能关闭隐身标签?也许有一种简单的方法可以将 url 与 pid 关联起来?

答案1

有很多注意事项,但你可以这样做。

不幸的是,命令行在管理的选项卡的 URL 方面并不是很有帮助。Chrome 有一个任务管理器(在菜单中的“更多工具”下),因此显然存在选项卡到进程的映射,但它可能位于 Chrome 进程之一内,不易访问。新的 Chrome 进程似乎通过某种形式的进程间通信,因此使用--service-pipe-token开关,而不是仅通过命令行。

不过,我确实注意到了区分隐身进程和正常进程的开关:--disable-databases技术上它“禁用 HTML5 DB 支持”,因此如果父进程明确指定了该标志,则非隐身进程也会拥有它,否则确实添加了仅适用于隐身进程。因此,您可以使用以下 PowerShell 命令:

gwmi win32_process | ? {$_.Name -eq 'chrome.exe' -and $_.CommandLine.Contains('--disable-databases')} | % {kill -Id $_.ProcessId}

虽然这确实会停止所有隐身进程,但它不一定关闭隐身窗口或标签。当我尝试时,所有隐身标签都变成了错误页面,但仍然保留着。唉,这似乎是我们能做的最好的事情了。

相关内容