1
NodeJSがパラメータで指定した文字列をファイルから検索しようとしています。 PowerShell paramが空でない場合は
私が間違って何をやっている:
param(
[switch]$raw,
[string]$input
)
[string]$file = "*.log"
if($raw) { $file = ".\raws\*.log" }
Get-ChildItem -Recurse -Include $file | select-string $input
問題は、私は$input
が空であること、エラーを取得していますということですか?
'$ input'は[自動変数](https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/about/about_automatic_variables)ですあなたのコードの名前。なぜそれが壊れているのか分かりませんが、確かに誤解を招きます。 – TessellatingHeckler
それは@TessellatingHecklerになります。どうもありがとうございました。 – Farcrada
[$ \ _と\ [parameter(ValueFromPipeline = $ true)\]の間の奇妙な差異の可能な複製(http://stackoverflow.com/questions/13502949/strange-difference-between-and-parametervaluefrompipeline-true) –