【发布时间】:2013-09-24 08:11:12
【问题描述】:
我有一个像下面这样的类
namespace Foo.Bar
{
public static class ParentClass
{
public const string myValue = "Can get this value";
public static class ChildClass
{
public const string myChildValue = "I want to get this value";
}
}
}
我可以使用 powershell 获取 myValue,
[System.Reflection.Assembly]::LoadWithPartialName("Foo.Bar")
$parentValue = [Foo.Bar.ParentClass]::myValue
但我无法在 myChildValue 类中获取该类。有人可以帮忙吗?
认为它可能如下所示,但 $childValue 始终为空。
[System.Reflection.Assembly]::LoadWithPartialName("Foo.Bar")
$childValue = [Foo.Bar.ParentClass.ChildClass]::myChildValue
【问题讨论】:
标签: class powershell static