param(
[Parameter(Mandatory=$true)] [String]$src = "alpha",
[Parameter(Mandatory=$true)] [String]$dest = "beta",
[Parameter(Mandatory=$false)] [switch]$recurse
)
function main {
Write-Host $recurse
Write-Host $src
Write-Host $dest
}
main
param(
[Parameter(Mandatory=$true)]
[string]
$src = "alpha",
[Parameter(Mandatory=$true)]
[string]
$dest = "beta",
[Parameter(Mandatory=$false)]
[switch]
$recurse
)
function main {
Write-Host $recurse
Write-Host $src
Write-Host $dest
}
main
Example of looping over files and doing something with them
param(
[Parameter(Mandatory=$true)] [String]$dir
)
foreach ($file in Get-ChildItem -File $dir) {
jq -s -f .\filter.jq $dir\$file
}