locked
Push package to Octopus RRS feed

  • Question

  • Hi,

    I am new to Powershell and I am writing a script to push a package to Octopus Deploy.

    #Function to push packages to Octopus Deploy

    function Push-Package {
        param(
            $OctopusUri,
            $ApiKey,
            $Package
        )
        try{
          Write-Host "Pushing $($Package.Fullname) to Octopus"
          .\Octo.exe 'push' --package $Package.Fullname --server $OctopusUri --apiKey $ApiKey --logLevel 'verbose'
          Write-Host "Pushing $($Package.Fullname) to Octopus - Success"
        }
        catch{
           Write-Host "PUSH PACKAGE Exception--------- $_"
        }
    }

    $OctopusUri = "https://MyTestOctopus.local"
    $ApiKey = "API-3Z3NRPNLUTS6ULA2KDALWG6A3HA"
    $PackageFolder = "c:\temp\OctoTest"

    Push-Package "https://MyTestOctopus.local" "API-3Z3NRPNLUTS6ULA2KDALWG6A3HA" "C:\temp\OctoTest\MyTestPackage.1.1.0.zip"

    I am getting an error:

    PUSH PACKAGE Exception--------- The term '.\Octo.exe' is not recognized as the name of a cmdlet, function, script file, or operable program

    I am not sure what I am doing wrong above. Any help would be great.

    Monday, May 18, 2020 12:55 PM

All replies

  • The error message is pretty much exact.  There is no such program as the one you are trying to run.

    Please post issues with third party tools to the vendors forum.  This forum is not a support forum for other vendors products.


    \_(ツ)_/

    Monday, May 18, 2020 1:14 PM
  • Hi,

    I am new to Powershell and I am writing a script to push a package to Octopus Deploy.

    #Function to push packages to Octopus Deploy

    function Push-Package {
        param(
            $OctopusUri,
            $ApiKey,
            $Package
        )
        try{
          Write-Host "Pushing $($Package.Fullname) to Octopus"
          .\Octo.exe 'push' --package $Package.Fullname --server $OctopusUri --apiKey $ApiKey --logLevel 'verbose'
          Write-Host "Pushing $($Package.Fullname) to Octopus - Success"
        }
        catch{
           Write-Host "PUSH PACKAGE Exception--------- $_"
        }
    }

    $OctopusUri = "https://MyTestOctopus.local"
    $ApiKey = "API-3Z3NRPNLUTS6ULA2KDALWG6A3HA"
    $PackageFolder = "c:\temp\OctoTest"

    Push-Package "https://MyTestOctopus.local" "API-3Z3NRPNLUTS6ULA2KDALWG6A3HA" "C:\temp\OctoTest\MyTestPackage.1.1.0.zip"

    I am getting an error:

    PUSH PACKAGE Exception--------- The term '.\Octo.exe' is not recognized as the name of a cmdlet, function, script file, or operable program

    I am not sure what I am doing wrong above. Any help would be great.

    provide full path to octo.exe or navigate to the folder where this exe file stores

    The opinion expressed by me is not an official position of Microsoft

    Monday, May 18, 2020 1:22 PM