如何将所需的参数传递给 Powershell ISE 中的脚本? [英] How to pass needed parameters to script in Powershell ISE?

查看:56
本文介绍了如何将所需的参数传递给 Powershell ISE 中的脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

见标题.

我在脚本的头部指定了需要的参数:

I specified needed parameters in the head of a script:

param ($G_ARCHIVE = $(throw "Need file to upload!"),
       $G_LOGFILE = $(throw "Need logfile!"))

当我想用 Powershell ISE 调试脚本时:如何填写这些参数?

When I want to debug the script with Powershell ISE: how can I fill these parameters?

推荐答案

使用命令窗格.在 ISE 编辑器中打开脚本文件,设置断点 (F9).然后在命令窗格中键入一个命令,使用所需的参数调用此脚本.我认为在 ISE 中没有另一种(内置的)方式来做到这一点.

Use the command pane. Open the script file in the ISE editor, set the breakpoints (F9). Then in the command pane type a command invoking this script with required parameters. I do not think there is another (built-in) way of doing this in ISE.

这篇关于如何将所需的参数传递给 Powershell ISE 中的脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆