# PowerShell Cheat Sheet ###### tags: `powershell, cheat sheet` > powershell commands notes :bulb::rocket: ## Commands #### Search a directory or file ( Get-ChildItem ) * specific path ( -Path C:\PATH\ ) * string patterns to be matched including folder titles ( -Include \*WORD\* ) * recursive search ( -Recurse ) * include hidden files ( -Force ) ```powershell Get-ChildItem -Path C:\Windows\System32\ -Include *power* -Recurse -Force ```  * ignore errors (shows in red) of directories or files that I do not have access ( -ErrorAction SilentlyContinues) ```powershell Get-ChildItem -Path C:\Windows\System32\ -Include *power* -Recurse -Force -ErrorAction SilentlyContinue ```  * show only files ( -File ) * Output results to a file in a specific path ( | Out-File -FilePath C:\PATH\file.txt ) ```powershell Get-ChildItem -Path C:\Windows\System32\ -Include *power* -Recurse -Force -ErrorAction SilentlyContinue -File | Out-File -FilePath C:\file.txt ```   :::info :pushpin: References * [docs.microsoft.com](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.2) * [devblogs.microsoft.com](https://devblogs.microsoft.com/scripting/use-windows-powershell-to-search-for-files/) :::
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up