脚本内容如下:

Write-Host "本机IP地址为:"(ipconfig|findstr "IPv4")[1].split(":")[1] -ForegroundColor Green
Read-Host "输入任意键退出"

也可以根据你的需求随机应变:

Write-Host "本机IP地址为:"(ipconfig|findstr "IPv4"|findstr "xx.xxx").split(":")[1] -ForegroundColor Green
Read-Host "输入任意键退出"

保存到桌面,右键PowerShell运行:

通过PowerShell查询本机IP地址

效果如下:

通过PowerShell查询本机IP地址

不要觉得太简单,你磊哥教你的永远都是最实用的。老铁,没毛病。

相关文章:

  • 2021-12-24
  • 2021-11-22
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2021-07-10
  • 2022-02-08
  • 2022-12-23
  • 2021-12-24
  • 2021-10-29
  • 2021-10-14
相关资源
相似解决方案