Installing Nuget package to Custom install Directory though script

I need to install the Nuget package from Octopus custom script. I could able to pull the package from feed. To install the package I am using “nuget install $packageName -source $sourceFeed -OutputDirectory $rootPath” commandlet.
This one copying the extracted folder to path. But what I need is after the nuget extraction to website rootpath, copy the package files similar to “Deploy a package” step template does when we specify “Custom install directory”.
e.g: for mypackage.nupkg, which contains “bin/test.dll”, when I install this in destination server script should be able to place dll under existing “website/ bin” folder

as of now I am continuing with nuget copy-item scripts. It would be great if we have some API which does the needed work.

Hi Vikram,

Thanks for getting in touch! I am trying to figure out what you are trying to do here. Have you tried our existing package deployment step? It already pulls from a NuGet feed and unpacks the package. It will go to a custom installation directory based on the package contents and structure. I feel like I might be missing something? explains about the package step that does most of this for you.
It has features like:

Could you explain why you are writing the installation yourself?

Thanks Vanessa.

My requirement is based on some xml values in nuget package verify dependencies deploy if they does not exits in target machine. I am aware of existing “Deploying package”. But the problem is I cannot use “Deploy Package” for automating multiple dependency check and installing packages. Thus I am trying to do using post deploy script. Please correct me if I am wrong.


Hi Vikram,

I just wanted to check in to see how you were progressing.