can't get -NotMatch to work with win32_process

New Contributor

i have a script that looks at running processes for browser processes "firefox.exe" or "chrome.exe". but it doesnt seem to work. it detects that chrome and firefoxportable is not detected even thought i have it running.

 

 

 

$processlist=gwmi win32_process|select CommandLine|Select-String -Pattern chrome.exe,firefox.exe
write-output $processlist

If ($processlist -NotMatch "GoogleChromePortable") {
write-output "chrome not detected"
}

If ($processlist -NotMatch "\\FirefoxPortable\\") {
write-output "FirefoxPortable not detected"
}
If ($processlist -Match "\\FirefoxPortable2\\") {
write-output "FirefoxPortable2 not detected"
}
If ($processlist -Match "\\FirefoxPortable3\\") {
write-output "FirefoxPortable3 not detected"
}

 

 

 

output:

 

 

 

@{CommandLine=C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe -profile
C:\Users\kuand\Documents\FirefoxPortable\Data\profile -no-remote}
@{CommandLine=C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe -profile
C:\Users\kuand\Documents\FirefoxPortable2\Data\profile -no-remote}
@{CommandLine=C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe -profile
C:\Users\kuand\Documents\FirefoxPortable3\Data\profile -no-remote}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.0.1027837490\1009405954" -parentBuildID 20210504152106 -prefsHandle 1644 -prefMapHandle 1676
-prefsLen 1 -prefMapSize 251699 -appdir "C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280
"\\.\pipe\gecko-crash-server-pipe.32280" 1792 gpu}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.6.1212891579\673506263" -childID 1 -isForBrowser -prefsHandle 2660 -prefMapHandle 2656 -prefsLen 894
-prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 2672
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.20.2096479210\911426814" -childID 3 -isForBrowser -prefsHandle 4228 -prefMapHandle 4024 -prefsLen 989
-prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 4088
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.27.1455219677\737006203" -childID 4 -isForBrowser -prefsHandle 4456 -prefMapHandle 4504 -prefsLen 989
-prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 4448
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.0.1818423543\1605324687" -parentBuildID 20210504152106 -prefsHandle 1608 -prefMapHandle 1692 -prefsLen
1 -prefMapSize 252437 -appdir "C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708
"\\.\pipe\gecko-crash-server-pipe.708" 1816 gpu}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.34.1263170681\93412674" -childID 5 -isForBrowser -prefsHandle 5492 -prefMapHandle 5528 -prefsLen 6685
-prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 5576
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.6.199216986\1337229495" -childID 1 -isForBrowser -prefsHandle 2872 -prefMapHandle 2868 -prefsLen 898
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 2880
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.20.800312422\768007849" -childID 3 -isForBrowser -prefsHandle 4316 -prefMapHandle 4312 -prefsLen 993
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 4328
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.48.508856643\657074073" -childID 7 -isForBrowser -prefsHandle 10132 -prefMapHandle 10136 -prefsLen
6751 -prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280"
10120 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.0.2019646530\1802192610" -parentBuildID 20210504152106 -prefsHandle 1800 -prefMapHandle 1796
-prefsLen 1 -prefMapSize 253217 -appdir "C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 -
1908 gpu}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.27.1856157123\226637890" -childID 4 -isForBrowser -prefsHandle 5400 -prefMapHandle 5376 -prefsLen 6645
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 5412
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.6.1254390342\729795331" -childID 1 -isForBrowser -prefsHandle 2640 -prefMapHandle 2632 -prefsLen 824
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 2652 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.41.278929740\1196303478" -childID 6 -isForBrowser -prefsHandle 5856 -prefMapHandle 5852 -prefsLen 6711
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 5864
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.13.1842117807\1434753226" -childID 2 -isForBrowser -prefsHandle 4444 -prefMapHandle 4440 -prefsLen
919 -prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 4456 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.20.1397535651\181140971" -childID 3 -isForBrowser -prefsHandle 4632 -prefMapHandle 4628 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 2932 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.27.1757915203\683251463" -childID 4 -isForBrowser -prefsHandle 4752 -prefMapHandle 4756 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 4580 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.34.464953611\1436179435" -childID 5 -isForBrowser -prefsHandle 4748 -prefMapHandle 4920 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 4916 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.41.1484637769\61008708" -childID 6 -isForBrowser -prefsHandle 4288 -prefMapHandle 4316 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 5108 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.48.1094784849\526004255" -childID 7 -isForBrowser -prefsHandle 5184 -prefMapHandle 5188 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 5256 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.55.1763573014\189394362" -childID 8 -isForBrowser -prefsHandle 4288 -prefMapHandle 4424 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 5288 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.62.1413613940\766014382" -childID 9 -isForBrowser -prefsHandle 5832 -prefMapHandle 5852 -prefsLen 919
-prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 5788 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.69.290952373\1345575100" -childID 10 -isForBrowser -prefsHandle 7508 -prefMapHandle 5420 -prefsLen
6976 -prefMapSize 253217 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 - 7484 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.55.500114489\1211004330" -childID 8 -isForBrowser -prefsHandle 4240 -prefMapHandle 9840 -prefsLen
6952 -prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 5268
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.62.1737453149\249918842" -childID 9 -isForBrowser -prefsHandle 8372 -prefMapHandle 8376 -prefsLen
6952 -prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 8420
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.69.1676147553\1888616109" -childID 10 -isForBrowser -prefsHandle 8264 -prefMapHandle 8260 -prefsLen
6952 -prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 8272
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.76.340122060\702497067" -childID 11 -isForBrowser -prefsHandle 1248 -prefMapHandle 1616 -prefsLen
6952 -prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280"
10140 tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\firefox.exe" -contentproc
--channel="32280.83.1965015805\1717588162" -childID 12 -isForBrowser -prefsHandle 7964 -prefMapHandle 7968 -prefsLen
6952 -prefMapSize 251699 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable\App\firefox64\browser" - 32280 "\\.\pipe\gecko-crash-server-pipe.32280" 8000
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.48.2064883553\847756466" -childID 7 -isForBrowser -prefsHandle 3444 -prefMapHandle 5008 -prefsLen 6758
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 2408
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.55.576066106\326507723" -childID 8 -isForBrowser -prefsHandle 5004 -prefMapHandle 6668 -prefsLen 6758
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 3644
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.62.613264775\17038639" -childID 9 -isForBrowser -prefsHandle 1576 -prefMapHandle 6356 -prefsLen 6758
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 6592
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.69.608041429\126312752" -childID 10 -isForBrowser -prefsHandle 6804 -prefMapHandle 6500 -prefsLen 6758
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 6468
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.76.1817812537\835803251" -childID 11 -isForBrowser -prefsHandle 3780 -prefMapHandle 6800 -prefsLen 6758
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 3604
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\firefox.exe" -contentproc
--channel="708.83.2103839855\312605648" -childID 12 -isForBrowser -prefsHandle 6792 -prefMapHandle 3364 -prefsLen 6758
-prefMapSize 252437 -parentBuildID 20210504152106 -appdir
"C:\Users\kuand\Documents\FirefoxPortable2\App\firefox64\browser" - 708 "\\.\pipe\gecko-crash-server-pipe.708" 3656
tab}
@{CommandLine="C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\firefox.exe" -contentproc
--channel="13908.76.217218652\1589541068" -parentBuildID 20210504152106 -prefsHandle 10304 -prefMapHandle 10520
-prefsLen 7354 -prefMapSize 253217 -appdir "C:\Users\kuand\Documents\FirefoxPortable3\App\firefox64\browser" - 13908 -
3196 rdd}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe"
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile"
--disk-cache-dir="C:\Users\kuand\AppData\Local\Temp\GoogleChromePortable" }
@{CommandLine=C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe --type=crashpad-handler
--user-data-dir=C:\Users\kuand\Documents\GoogleChromePortable\Data\profile /prefetch:7
--monitor-self-annotation=ptype=crashpad-handler
--database=C:\Users\kuand\Documents\GoogleChromePortable\Data\profile\Crashpad
--metrics-dir=C:\Users\kuand\Documents\GoogleChromePortable\Data\profile --url=https://clients2.google.com/cr/report
--annotation=channel= --annotation=plat=Win32 --annotation=prod=Chrome --annotation=ver=87.0.4280.66
--initial-client-data=0x2e4,0x2e8,0x2ec,0x248,0x2f0,0x5bad79f8,0x5bad7a08,0x5bad7a14}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=gpu-process
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --gpu-preferences=MAAAAAAAAADgAAAwAAAAAAAA
AAAAAAAAAABgAAAAAAAQAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAgAAAAAAAAACgAAAAAAAAAMAAAAAAAAAA4AAAAAAAAABAAAAAAAAAAAAAAAAUAAAAQAAA
AAAAAAAAAAAAGAAAAEAAAAAAAAAABAAAABQAAABAAAAAAAAAAAQAAAAYAAAA= --mojo-platform-channel-handle=1788 /prefetch:2}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=utility
--utility-sub-type=network.mojom.NetworkService
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US --service-sandbox-type=network
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --mojo-platform-channel-handle=2000
/prefetch:8}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=utility
--utility-sub-type=storage.mojom.StorageService
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US --service-sandbox-type=utility
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --mojo-platform-channel-handle=2392
/prefetch:8}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile"
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=20 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=3024 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile"
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=19 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=3036 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile"
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=21 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=3156 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=5 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=3604 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=6 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=3944 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=7 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4128 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=8 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4176 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=9 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=2688 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=10 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4212 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=11 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4308 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=12 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4380 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=13 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4204 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=14 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4100 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=15 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4580 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=16 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4608 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=17 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4644 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=renderer
--field-trial-handle=1760,11890821617244175734,10769512138461397624,131072 --lang=en-US
--user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile" --extension-process
--origin-trial-disabled-features=SecurePaymentConfirmation --device-scale-factor=1 --num-raster-threads=4
--enable-main-frame-before-activation --renderer-client-id=18 --no-v8-untrusted-code-mitigations
--mojo-platform-channel-handle=4776 /prefetch:1}
@{CommandLine="C:\Users\kuand\Documents\GoogleChromePortable\App\Chrome-bin\chrome.exe" --type=utility
--utility-sub-type=audio.mojom.AudioService --field-trial-handle=1760,11890821617244175734,10769512138461397624,131072
--lang=en-US --service-sandbox-type=audio --user-data-dir="C:\Users\kuand\Documents\GoogleChromePortable\Data\profile"
--mojo-platform-channel-handle=6868 /prefetch:8}
FirefoxPortable not detected
FirefoxPortable2 not detected
FirefoxPortable3 not detected

 

 

1 Reply

@dwaynek7 

Dear

Yes, surely it wont be detected as running, 

the object is $processlist is an array and you will need to go through objects in the array. 

Also the array item contain multiple properties and one of them is Line

You can use the command as the following

 

$processlist=gwmi win32_process|select CommandLine|Select-String -Pattern chrome.exe,firefox.exe
$processlist.ForEach({If ($_.Line -like "*Google*"){write-output "Google is running"}
})