Octopus / Powershell question

Is it possible to have a custom powershell script retrieve the version of:

  1. A dll inside of the octopus package

  2. The version of the octopus package

Hi,

Thanks for getting in touch!

It is possible to retrieve both of the versions numbers in question.

The first one is a bit trickier than the second. The following script example shows how it can be done:

$path = "C:\Windows\System32\advapi32.dll"
$info = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path)
write-host $info.ProductVersion

For the second version number we have a variable specifically for that purpose:
Octopus.Action.Package.NuGetPackageVersion

So for your PowerShell script you could use:

$PackageVersion = $OctopusParameters["Octopus.Action.Package.NuGetPackageVersion"]

Let me know how this goes!

Vanessa

Thanks Vanessa.