PowerShell - Search

Published: 29 April 2021
on channel: Mr Automation
2,182
30

(How to search files, registry and certificates, with powershell)
In this video I demonstrate different ways of finding information on your computer with powershell.

*searching into files to find specific values or strings.
*searching in the registry for certains keys and their values.
*access the certificate store on your local computer
*search for a specific certificate.

*powershell
*learn powershell
*automation
*learn automation
*windows
*windows powershell

Code:

Get-ChildItem ~ -Recurse -Filter *.txt | where {$_.name -match 'yes'} | select FullName
Get-ChildItem ~ -Recurse -Filter *.txt | Select-String "very important"
Get-ChildItem ~ -Recurse | where {$_.LastWriteTime -gt (get-date).AddMinutes(-5)} | select fullname
$ipv4 = '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
$t = Get-ChildItem ~ -Recurse -Filter *.txt | Select-String $ipv4
Get-ChildItem ~ -Recurse -File | where {
$PSItem.Length -ge 1 -and $PSItem.Length -lt 10
} | select FullName, Length | ogv

Get-ChildItem D:\__DEMOS -Recurse -File -Filter *.ps1 | Select-String "vpnbook" |
select Filename, LineNumber, Path, Pattern

Get-ChildItem "HKLM:\Software\" -Recurse | where {
$_.name -match 'installer'
}

cd Cert:
cd .\\LocalMachine\
cd .\Root\
ls | where subject -match 'USERTrust'
ls | where subject -match 'USERTrust' | select *


Watch video PowerShell - Search online, duration hours minute second in high quality that is uploaded to the channel Mr Automation 29 April 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,182 times and liked it 30 visitors.