简体   繁体   中英

Convert a bash script into PowerShell

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

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM