![](/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.