Skip to content

Powershell Cheatsheet

Working with files

find files with spec Name 

Get-ChildItem -Path C:\ -Include password.txt -File -Recurse -ErrorAction SilentlyContinue

find Files typ *.bak 

Get-ChildItem -Path C:\ -Include *.bak* -File -Recurse -ErrorAction SilentlyContinue 

cat in PS

Get-Content "C:\Program Files\root.txt" 

Search for strings in Files 

Get-ChildItem C:\* -Recurse | Select-String -pattern password

get directory permission

Get-Acl C:/

pwd in ps

Get-Location

create MD5 hash from file

Get-FileHash -Path "C:\Temp\text.txt" -Algorithm MD5 

encode base64

certutil -encode "C:\Temp\text.txt" base64.txt

decode base64

certutil -decode "C:\Temp\base64.txt" text.txt
Back To Top