4

I am looking for a way to distribute Powershell modules, and trying to use nuget.

I have tested to make a commonstuff.pm1 file. I have make a nuget package as:

put commonstuff.pm1 > Content folder i package
add a install.ps1 in tools
Push:ed the packe to the nugetserver (A internal ProGet server)

The install.ps1 is

$p = $env:PSModulePath.split(';')[0] + "\\commonstuff"
mkdir $p
copy ./commonstuff.pm1 $p

It works fine to run the install.ps1 manually, but running as a nuget package doesn't: it just downloads the package to the current location and that is.

To download i use the command
nuget.exe install commonstuff -Source http://companysvr/nuget/test   

I have the latest version of nuget.exe

Is there a recommended way of installing PowerShell modules using nuget? I can't find one.

3

1 Answer 1

0

When you installing a package via Nuget.exe, the powershell scripts will not be executed. The package will just extracted in the specified folder.

You have to install it from visual studio package manager console to execute the install.ps1 scripts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.