Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, September 19, 2019 1:00 AM
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.
All replies (2)
Thursday, September 19, 2019 1:32 AM
Somebody needs to learn the basics of computers before taking on such technically challenging projects.
Get-Content C:\Users\Administrator\Desktop\test.txt |
ForEach-Object{
curl.exe "http://mysite.com/text/$_"
}
\(ツ)_/
Thursday, October 3, 2019 2:50 AM
Hi,
Was your issue resolved?
If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
If no, please reply and tell us the current situation in order to provide further help.
Best Regards,
Lee
Just do it.