I have something I have put together to scan computers on my network and look for certain chrome extensions.
It works and displays the information in the PowerShell console. But if it finds the extension in multiple user profiles on a machine it creates a giant blob of information instead of separating it into multiple lines and I would like to have this output to a txt or csv file:
$hostnamestxt = "Server with list of computers"
$computers = get-content “$hostnamestxt”
write-host Scanning........
foreach($computer in $computers){
$BetterNet = "\\$computer\c$\users\*\AppData\Local\Google\Chrome\User Data\Default\Extensions\gjknjjomckknofjidppipffbpoekiipm"
if (Test-Path $BetterNet) {
$a = Get-ChildItem $BetterNet
write-host BetterNet found on:
Write-Host " "$a
write-host
}
You probably want to enumerate the return value of the Get-ChildItem cmdlet:
Get-ChildItem $BetterNet | ForEach-Object {
write-host BetterNet found on:
Write-Host " "$_
write-host
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With