Hi,
Wrote a script which will loop through multiple server and store the output in a file. But, the script is giving me an error.
Get-Content .\server.txt |
ForEach-Object{
get-childitem “c:\test*” -recurse | SELECT-STRING -pattern “$11t$dpo3”
}|
Select path, pattern, Linenumber |
Export-Csv C:\Users\admin\Desktop\Test\Search_String\string_match_results.csv -NoType
Error:
Select-String : Cannot bind argument to parameter ‘Pattern’ because it is an empty string.
At C:\Users\admin\Desktop\Test\Search_String\Final.ps1:5 char:68
-
get-childitem "c:\opscripts\*" -recurse | SELECT-STRING -pattern "$11t$dpo3"
-
~~~~~~~~~~~
- CategoryInfo : InvalidData: (
[Select-String], ParameterBindingValidationExceptio
n - FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Powe
rShell.Commands.SelectStringCommand
- CategoryInfo : InvalidData: (
Can someone please guide me on this.
-Kalyan