当调用exe文件时,需将文件后缀改为dll,否则无法引用。 Visual Studio 可以引用exe文件。 Import-module “G:/Microsoft/VSProjects/ClassLibrary1/bin/Debug/ClassLibrary1.dll" $class1 = new-object 'ClassLibrary1.Class1' $class1 | get-member $class1.Test()