forked from PolarBearGod/CrowdStrike-RTR-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
List-chromeExtensions.ps1
3 lines (3 loc) · 1016 Bytes
/
List-chromeExtensions.ps1
1
2
3
function ConvertFrom-Json20([object] $item){add-type -assembly system.web.extensions;$ps_js=new-object system.web.script.serialization.javascriptSerializer;return ,$ps_js.DeserializeObject($item);};$output = 'User, Extension Location, Extension Name, Version' + [System.Environment]::NewLine;$users = Get-ChildItem "c:\users" | Where-Object{ $_.PSIsContainer};foreach ($user in $users){$extpath = 'c:\users\' + $user + '\appdata\local\Google\Chrome\User Data\*\Extensions\';$extensions = Get-ChildItem $extpath -Recurse -include "manifest.json" -ErrorAction "silentlycontinue" -force;foreach ($extension in $extensions){$content = Get-Content $extension.FullName -Raw;$json = $content | ConvertFrom-JSON;$output += $user.Name + ', ' + $extension.FullName + ', ' + $json.name + ', ' + $json.version + [System.Environment]::NewLine;};};$output;
# Delete this line and the comment hashes to have this export the contents to the host.
# | Export-Csv -Path "c:\$env:COMPUTERNAME-chromeExtensions.csv" -NoTypeInformation