I'm trying to search through files for a string given in parameters by NodeJS.
param(
[switch]$raw,
[string]$input
)
[string]$file = "*.log"
if($raw) { $file = ".\raws\*.log" }
Get-ChildItem -Recurse -Include $file | select-string $input
The problem is that I'm getting the error that $input is empty:

What am I doing wrong?
$inputis an automatic variable you shouldn't use that name in your code. Not sure if that's why it's breaking, but it's certainly misleading.