简体   繁体   English

Powershell脚本未执行

[英]Powershell script not being executed

I have a powershell script that takes an input parameter (int). 我有一个采用输入参数(int)的powershell脚本。 the script then updates the status of the service based on this input parameter. 然后,脚本将根据此输入参数更新服务的状态。 I have been working on this task using the powergui editor . 我一直在使用powergui编辑器来完成此任务。

Screencap from powergui window PowerGUI窗口的屏幕截图

在此处输入图片说明

在此处输入图片说明

Whenever I try to run the script from the command line of powershell file, there is nothing that's being reported by powershell . 每当我尝试从powershell文件的命令行运行脚本时,powershell都不会报告任何内容。 No output .. nothing. 没有输出..什么都没有。
Screencap from powershell window Powershell窗口的屏幕截图

在此处输入图片说明 Can you please let me know what might be happening here. 您能否让我知道这里可能会发生什么。

Thanks 谢谢

Maybe you called the programm services.exe from the command line. 也许您从命令行调用了programm services.exe You might try to rename your function. 您可以尝试重命名函数。

You might know the following allready, but did you parse your powershell script before you called your function? 您可能已经知道以下所有内容,但是在调用函数之前是否解析了Powershell脚本? This is nessesary to include your function into the shell. 这是将您的函数包含到外壳中的必要条件。 You have to invoke D:\\ps>.\\myScript.ps before you can use the function. 您必须先调用D:\\ ps>。\\ myScript.ps,然后才能使用该函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM