1.安装visual studio code
2.安装powershell extension
3.打开脚本文件
4.F1,然后输入format,找到format document的选项
但是这个用起来有点不太理想,傻乎乎的。
通过导入powershell module进行操作,module提供了函数
powershell脚本的格式化
原文:https://www.cnblogs.com/chucklu/p/10533045.html