Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| powershell_examples [2022/09/23 19:50] – [Powershell Examples] mgupton | powershell_examples [2023/01/30 13:48] (current) – mgupton | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Powershell Examples ====== | ====== Powershell Examples ====== | ||
| + | * code snippets | ||
| + | |||
| + | |||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| Line 46: | Line 49: | ||
| main | main | ||
| </ | </ | ||
| + | |||
| + | ====== Loop Over Files ====== | ||
| + | === Example of looping over files and doing something with them === | ||
| + | <code powershell> | ||
| + | param( | ||
| + | [Parameter(Mandatory=$true)] [String]$dir | ||
| + | ) | ||
| + | |||
| + | foreach ($file in Get-ChildItem -File $dir) { | ||
| + | jq -s -f .\filter.jq $dir\$file | ||
| + | } | ||
| + | </ | ||
| + | |||