![](/img/trans.png)
[英]How do I install the Nuget provider for PowerShell on a offline machine?
[英]Use nuget to install PowerShell modules at user machine
我正在寻找一种方法来分发Powershell模块,并尝试使用nuget。
我已经测试过makestuff.pm1文件。 我做了一个nuget包:
put commonstuff.pm1 > Content folder i package
add a install.ps1 in tools
Push:ed the packe to the nugetserver (A internal ProGet server)
install.ps1是
$p = $env:PSModulePath.split(';')[0] + "\\commonstuff"
mkdir $p
copy ./commonstuff.pm1 $p
它可以手动运行install.ps1,但作为nuget包运行不会:它只是将包下载到当前位置,即。
To download i use the command
nuget.exe install commonstuff -Source http://companysvr/nuget/test
我有最新版本的nuget.exe
是否有推荐的方法使用nuget安装PowerShell模块? 我找不到一个。
通过Nuget.exe安装程序包时,将不会执行powershell脚本。 该包只会在指定的文件夹中解压缩。
您必须从visual studio包管理器控制台安装它才能执行install.ps1脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.