简体   繁体   English

将Bash脚本转换为PowerShell

[英]Converting Bash script to PowerShell

I am writing a Wifi test script in Powershell. 我正在Powershell中编写Wifi测试脚本。 I have managed to do it in Bash and now I want to port it. 我已经设法在Bash中做到了,现在我想移植它。 I am looking for command similar to: 我正在寻找类似的命令:

  1. Syslog: to log WPA and SSID changes. Syslog:记录WPA和SSID更改。
  2. Iwconfig: which logs current wifi config Iwconfig:记录当前的wifi配置

Here's my current script: 这是我当前的脚本:

#!/bin/sh
/var/log/syslog | grep SSID /var/log/syslog | grep wpa

Windows dont work like linux do and so on.. So there is much to think of here and there are no simple way to get the information that you want here. Windows无法像linux一样工作,等等。.因此,这里有很多需要考虑的地方,没有简单的方法可以在此处获取所需的信息。


"1. Syslog: to log WPA and SSID changes" “ 1. Syslog:记录WPA和SSID更改”

For this one we would need to bind the drivers you have and make them output it to where it should be readable. 为此,我们需要绑定您拥有的驱动程序,并将其输出到应该可读的位置。 And so on.. 等等..

"2. Iwconfig: which logs current wifi config" “ 2. Iwconfig:记录当前的wifi配置”

This.. ipconfig is the command who is closest but dosent do what you want in this one. 这是.ipconfig命令,它是最接近的命令,但有必要执行此命令中的操作。


I would suggest that you try something in visual basic or maybe python. 我建议您尝试使用Visual Basic或python尝试一些操作。 Dont think it is a simple way to do this.. 不要以为这是一种简单的方法。

Hope it helped somehow. 希望它有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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