Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用nuget在用户计算机上安装PowerShell模块_Powershell_Module_Installation_Nuget - Fatal编程技术网

使用nuget在用户计算机上安装PowerShell模块

使用nuget在用户计算机上安装PowerShell模块,powershell,module,installation,nuget,Powershell,Module,Installation,Nuget,我正在寻找一种分发Powershell模块的方法,并尝试使用nuget 我已经测试过生成一个commonstaff.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

我正在寻找一种分发Powershell模块的方法,并尝试使用nuget

我已经测试过生成一个commonstaff.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脚本

看看我们用巧克力吗?