简体   繁体   English

Powershell:二进制模块设置版本号

[英]Powershell : Binary Module setting version number

Am writing a powershell binary module which is installed by an executable. 正在编写由可执行文件安装的powershell二进制模块。 On install I copy the binary files into my $env:PSModulePath path and hey presto the auto-loader picks them up and I can start using them. 在安装时,我将二进制文件复制到$ env:PSModulePath路径中,嘿,请记住,自动加载器将它们拾取后,我就可以开始使用它们了。

So far so good. 到现在为止还挺好。

Question, where does the Module get the version from. 问题,模块从哪里获得版本。

In my case the module has a version of 2.0.0.0 but my DLL has a version of 1.0.1963.0 在我的情况下,该模块的版本为2.0.0.0,但我的DLL的版本为1.0.1963.0

获取模块 DLL属性

Based on answer to the question here I had thought that it came from the dll version, but alas that does not seem to be the case. 基于对这里问题的回答,我认为它来自dll版本,但是可惜情况并非如此。

Can someone help ? 有人可以帮忙吗?

Take a look here and search for "Metadata about the module, such as the module version number, the author, and the description". 在此处查看并搜索“关于模块的元数据,例如模块版本号,作者和描述”。 And here you get an example for a Module Manifest. 在这里,您将获得模块清单的示例。

To get the version information of the file, this is useful: 要获取文件的版本信息,这很有用:

(Get-Item -Path "C:\Windows\System32\...").VersionInfo | Format-List

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

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