$MyInvocation.MyCommand.Path 在 PowerGUI 脚本编辑器中为 $null [英] $MyInvocation.MyCommand.Path is $null in PowerGUI script editor

查看:64
本文介绍了$MyInvocation.MyCommand.Path 在 PowerGUI 脚本编辑器中为 $null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在 powerGUI 脚本编辑器 (2.0.0.1082) 中调试我的 powershell 脚本时,$MyInvocation.MyCommand.Path 为 $null.它在通过 powershell 运行脚本时起作用.在 Powershell_ise.exe(在我们的一台服务器上)中运行它也可以正常工作.

有没有其他人遇到过同样的问题或知道出了什么问题?

这是我的 PowerShell 版本:

<前>名称值---- -----CLR 版本 2.0.50727.4927构建版本 6.1.7600.16385PS版本 2.0WSManStackVersion 2.0PSCompatibleVersions {1.0, 2.0}序列化版本 1.1.0.1PSRemotingProtocolVersion 2.1

服务器版本:

<前>名称值---- -----CLR 版本 2.0.50727.3082构建版本 6.0.6002.18111PS版本 2.0WSManStackVersion 2.0PSCompatibleVersions {1.0, 2.0}序列化版本 1.1.0.1PSRemotingProtocolVersion 2.1

解决方案

此问题已修复.从 http://powergui.org 下载最新版本的 PowerGUI,问题就会消失.

When trying to debug my powershell script in the powerGUI script editor (2.0.0.1082) the $MyInvocation.MyCommand.Path is $null. It works when running the script via powershell. Running it in Powershell_ise.exe (on one of our servers) also works fine.

Have anyone else had the same problem or know what's wrong?

Here's my powershell version:

Name                           Value
----                           -----
CLRVersion                     2.0.50727.4927
BuildVersion                   6.1.7600.16385
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

Server version:

Name                           Value
----                           -----
CLRVersion                     2.0.50727.3082
BuildVersion                   6.0.6002.18111
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

解决方案

This issue has been fixed. Download the latest version of PowerGUI from http://powergui.org and the issue will disappear.

这篇关于$MyInvocation.MyCommand.Path 在 PowerGUI 脚本编辑器中为 $null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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