> For the complete documentation index, see [llms.txt](https://gitbook.nori-zamurai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.nori-zamurai.com/useful-commands/powershell.md).

# Powershell

```
Get-Process notepad | Stop-Process -Force
# Kill process

$p = Get-Process notepad
$p | gm -foce
# Explore the methods and properties for an object
$p.CloseMainWindows
# Call specific function

```

#### Grep

```
Select-String -Path "audit.log" -Pattern "logon failed" -Context 2, 3
# display lines before /after match
```
