将bash脚本转换为PowerShell

将bash脚本转换为PowerShell,bash,powershell,unix,Bash,Powershell,Unix,我很抱歉, 我有一个(Bash)unixshell脚本,应该在PowerShell上运行。我想转换这个,但不知道如何转换 __猛击___ For i in $(cat ./readersG3.txt); Do rigado gateway remove-tag $i --key=ble-controller-PROD; Done 阅读此帖子 或 阅读此帖子 或 这是在bash中读取文件行的错误方法。请参阅。这是读取bash中文件行的错误方法。看见 Get-Content .\reade

我很抱歉, 我有一个(Bash)unixshell脚本,应该在PowerShell上运行。我想转换这个,但不知道如何转换

__猛击___

For i in $(cat ./readersG3.txt); 
Do rigado gateway remove-tag $i --key=ble-controller-PROD; 
Done
阅读此帖子

阅读此帖子


这是在
bash
中读取文件行的错误方法。请参阅。这是读取
bash
中文件行的错误方法。看见
Get-Content .\readersG3.txt | ForEach-Object {
  # do your operation on each $_
}
foreach($line in Get-Content .\readersG3.txt) {
   # do your operation  $line
}