Hi,
Having a little issue.
need to loop ip's listed in a text file into curl.
tried but failed here:
$d = "C:\Users\Administrator\Desktop\test.txt"
Get-Content $d |
ForEach-Object
{
Invoke-Command -ScriptBlock {curl.exe http://mysite.com/text/$($_.d)
}
}
it gives this:
cmdlet ForEach-Object at command pipeline position 2
Supply values for the following parameters:
Process[0]:
tried and failed here also:
$d = C:\Users\Administrator\Desktop\text.txt
$i = Get-Content -Path C:\Users\Administrator\Desktop\text.txt
ForEach-Object -process {curl http://mysite.com/text/$i}
Thanks for any assistance in advance.