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
1
  • This is the wrong way to read the lines of a file in bash. See Bash FAQ 001. Commented Feb 29, 2020 at 14:01

1 Answer 1

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
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.