Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

get string in logfile

$LogFile = "C:\TEMP\deploy.log"  
$Code = 'TEST'


$LastLines = Get-Content -path $LogFile  | select -Last 30 | select-string $Code


Select-String : Cannot bind argument to parameter 'Path' because it is an empty string.
At line:1 char:36
+ $StringExist = Select-String -path $LastLines -pattern $SearchCode
+                                    ~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Select-String], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Sele
   ctStringCommand

Thank you

Best regards 
Avatar of ste5an
ste5an
Flag of Germany image

The error message has nothing to do with your posted fragment.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial