I've been trying to integrate a PowerShell script inside a Batch file but I seem to get some errors when trying to do so.
This is my code so far:
for /F "tokens=* delims=," %%A in (C:\MACs.log) do (
@ECHO OFF
PowerShell.exe "& arp -a | select-string "%%A" |% {$_.ToString().Trim().Split(" ")[0]} >> C:\tempfile.log
Ok so, when I run this command in PowerShell everything is working OK but in Batch I get some token errors.
The main post of this code is to create a loop from the MACs.log where I have a couple of MAC addresses that I want the IP addresses to and output them to tempfile.log.
If someone can lend a helping hand it would be greatly appreciated.