

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Windows PowerShell 文件
<a name="using-powershell-files-with-session-scripts"></a>

要使用 Windows PowerShell 文件，请在**filename**参数中指定 PowerShell 文件的完整路径：

```
"filename": 
"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
```

然后，在 **arguments** 参数中指定您的会话脚本：

```
"arguments": "-File \"C:\\path\\to\\session\\script.ps1\"",
```

最后，验证 PowerShell 执行策略是否允许您的 PowerShell 文件运行。