PowerShell 运行ps1文件

来源:互联网 发布:哈工大威海网络新系统 编辑:程序博客网 时间:2024/05/03 18:51

首先运行PowerShell。【powershell】

创建ps1文件,如test.ps1,存放在 C:\Users\hsing\Desktop    文件夹里

在控制台输入cd  C:\Users\hsing\Desktop 到test.ps1文件目录、

输入.\test.ps1 即可运行


注:.\表当前目录。

或直接输入  C:\Users\hsing\Desktop\test.ps1 即可。