0

I'm apologized, I have a (Bash) Unix shell script that should be run on PowerShell. I have to like to convert this but don't know how.

__ Bash___

For i in $(cat ./readersG3.txt); 
Do rigado gateway remove-tag $i --key=ble-controller-PROD; 
Done
  • This is the wrong way to read the lines of a file in `bash`. See [Bash FAQ 001](https://mywiki.wooledge.org/BashFAQ/001). – chepner Feb 29 '20 at 14:01

1 Answers1

2

Read this thread
Read file line by line in PowerShell

Get-Content .\readersG3.txt | ForEach-Object {
  # do your operation on each $_
}

or

foreach($line in Get-Content .\readersG3.txt) {
   # do your operation  $line
}