Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
James Dawson
@JamesDawson
As you say, this is hardly a core scenario and there are multiple ways around it one way or another... so you need to do whatever you're most comfortable with for the project as a whole. Thanks for your responsiveness.
jigneshjdesai
@jigneshjdesai
@Dalmirog any example on how to delete releases? I am trying Remove-OctopusResource -Resource $release but it is throwing error Remove-OctopusResource : Cannot bind parameter 'Resource'. Cannot convert the "Octoposh.Model.OutputOctopusRelease" value of type
"Octoposh.Model.OutputOctopusRelease" to type "Octopus.Client.Model.Resource".
jigneshjdesai
@jigneshjdesai
@jigneshjdesai
@Dalmirog any example on how to delete releases? I am trying Remove-OctopusResource -Resource $release but it is throwing error Remove-OctopusResource : Cannot bind parameter 'Resource'. Cannot convert the "Octoposh.Model.OutputOctopusRelease" value of type
"Octoposh.Model.OutputOctopusRelease" to type "Octopus.Client.Model.Resource". hey @Dalmirog not sure if you had chance to look into this. Appreciate your help.
ConwayO
@ConwayO
@Dalmirog , Is there any reason why the Powershell Module New-OctopusAPIKey isn't available in the latest Octoposh Build : 0.6.11? I have been able to Load up the Module in Powershell, but would obviously prefer that it be included in a future build. Kind Regards
ConwayO
@ConwayO
@Dalmirog Is there a way to retrieve all Deploy Environments that does not force Octopus deploy to Skip 10 Environments when sourcing the Required Environment?
@Dalmirog is there a way to interact with the api directly, using custom calls without the use of the defined octoposh methods? (Maintaining the authentication)
Dalmiro Granas
@Dalmirog

@jigneshjdesai remove-OctopusResource doesn't currently delete releases. I'm on a bus right now so can't get into the specifics of why, but the recommendation would be to use octo.exe delete-release.

I can give you the full explanation later tonight :)

Dalmiro Granas
@Dalmirog

@ConwayO

New-OctopusAPIKey - I simply didn't port this cmdlet after porting things to C#. I have #259 open for it. I'll do it this week as I've been asked about it quite enough :)

Environment question - Not sure Im following this one. Which cmdlet are you running and what you mean by "skip 10"

calling API directly - Yes you can run $c = new-Octopusconnection. Then you could do $c.repository.projects.findall() for example to get all the projects. $c will be an object that holds an authenticated connection with your Octopus instance. Is this what you needed?

@jigneshjdesai about using Octo.exe delete-releases, here's do documentation for it: https://octopus.com/docs/api-and-integration/octo.exe-command-line/deleting-releases

Remember that you can download Octo.exe using Octoposh as explained here: http://octoposh.readthedocs.io/en/latest/advancedexamples/running-deployments-with-octoposh/

ConwayO
@ConwayO
image.png
@Dalmirog Thank you for your Speedy response, New-OctopusKey would be awesome! , In terms of the environment question, please see image attached
On a side note, is there any way you know of to Use the AD Credentials for User / Password Login, instead of having to prompt the user continuously.
Below is a link that someone had used integrated-Challange (Cookies) to get the login information
Many thanks for your assistance
Dalmiro Granas
@Dalmirog
@conwayo what was the full scripts you ran when you were getting all those release calls?
ConwayO
@ConwayO
Hi @Dalmirog , I am using the Get-OctopusEnvironment Command. It does a recursive 302 Object Moved Response, which intern will go through each and every page of Environment Results verses the direct API call which will return every environment at once. ($env:OctopusDeploy/api/environments)
Any Feedback on the Cookie AD Credential Method ?
jigneshjdesai
@jigneshjdesai
@Dalmirog Thank a ton!
Dennis Dyallo
@DennisDyallo
Hi guys. I was looking at Octoposh as an alternative to using the REST Api to get the hostname of the machines I'm deploying to.
Something like;
$OctopusParameters['Deployment.Hostnames']
server1.example.com,server2.example.com
For some reason $OctopusParameters doesn't include this.
The closest thing is $OctopusParameters['Octopus.Deployment.Machines']
This returns the internal machine Id's like "machine123,machine124".
I'm not sure what use I would have for these, but I came to Octoposh thinking that something like:
Get-OctopushMachine -Id "machine123"
  • would work. Alas, it does not. Where should I be looking to get these hostnames? Should Octoposh be able to take an Id parameter?
kdiddy82
@kdiddy82
Hello, it looks like with the latest Octopus update there may be an incompatibility with the Octopus.Client.dll version. Here is a link to the breaking change that Octopus has identified. https://octopus.com/downloads/compare?from=4.1.8&to=2018.3.4
The version that comes with the module is 4.22.0 and the latest version they use is 4.31.1 . This appears to be breaking a few functions, such as Get-OctopusTeam . Any plans to upgrade to the latest version of Octopus?
Rob
@ephos
@kdiddy82 We ran into this issue as well. I cloned Octoposh from Github, updated the Octoposh projects packages.config to grab version 4.31.1 of Octopus.Client and recompiled the module. This fixed the problem for us. @Dalmirog do you have plans to make this change to the module?
danielgovier
@danielgovier

Hello, I need some help with Get-OctopusDeployment. I am using Octopus 3.4.13 and Octoposh 0.6.11.
I have a project and environment that have 34 deployments listed in the DeploymentHistory table in the database. Get-OctopusDeployment throws this error when I try

PS C:\WINDOWS\system32> Get-OctopusDeployment -ProjectName Myproject -EnvironmentName Myproject_prod
Get-OctopusDeployment : Nullable object must have a value.
At line:1 char:1

  • Get-OctopusDeployment -ProjectName Myproject -EnvironmentName Myproject_prod ...
  • ~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Get-OctopusDeployment], InvalidOperationException
    • FullyQualifiedErrorId : System.InvalidOperationException,Octoposh.Cmdlets.GetOctopusDeployment

Get-OctopusDeployment works fine for other projects with either more or fewer deployments. The project with errors has Successful, Failed and Cancelled deployments. That is also the case with projects that do not have errors.

KellyR-STCU
@KellyR-STCU
Is there a main OctopusDeploy channel? Can't seem to find one
danielgovier
@danielgovier
@KellyR-STCU there is an Octopus Deploy forum here: https://help.octopus.com/
Woffenden
@mwoffenden
We're holding our installation at v2018.2.8 after seeing this thread. Anyone know if a perm fix is in the works?
KellyR-STCU
@KellyR-STCU
@danielgovier Thanks. It is unfortunate that there is no real time discussion for the main product :)
Rob
@ephos
@Dalmirog I submitted a PR #316 which should fix the issue folks are seeing with the Octopus.Client version after upgrading. I wasn't sure if you were able to take a look or if you need anything else from me for it. Let me know! :smile:
wurzeldub
@wurzeldub
Hi folks - I am wondering if anyone knows of any sample code that can be used to set octopus project variables from code.
Our product has 50 projects and I would love to be able to automate the process of setting up new customers.
I am tired of doing this manually.
Any help greatfully received. Thanks
Neil
@ITGuyOU
Could you fix the "EmailAddress" property in OutputOctopusUser.cs that is misspelled "EmailAdress"?
Rob
@ephos
@Dalmirog The project has been quiet for awhile, I wasn't sure if you were able to review my PR #316 yet? We (and I am assuming others) are having to clone and recompile the module internally for updated versions of Octopus Deploy Server which requires the newer Octopus.Client library. This isn't ideal as our preference would be to pull it from the PS Gallery. Is there anything I can do to help?
Stephen Shamakian
@StephenShamakian
@Dalmirog Any update to this? We upgraded our Octopus Server and were forced to upgrade OctoPosh to get Latest Deployments working again but now we can't clone projects anymore.
Stephen Shamakian
@StephenShamakian
@Dalmirog Also when performing a "Get-OctopusProject" to get all projects I keep getting this error "Sequence contains no elements"
KSchiss
@KSchiss
Hi all - I was recently observing a colleague adding environments to a Lifecycle phase - he has a lot of envs to add, and I was wondering if Octoposh would be able to do this for us, instead of adding them all in via the GUI? Thanks.
mkvideodj
@mkvideodj
Hello - can anyone advise me on how to use the OctoPosh Update-OctopusVariableSet function? I've imported the OctoPosh module and this function isn't listed. I'm trying to import the JSON export of a variable set from another Octopus instance. Thanks in advance
Rob
@ephos
@StephenShamakian I have a pending PR waiting review which updates the Octopus.Client dependency. At this point you can grab that code and compile it and it should work (far from ideal, I know). We're maintaining it this way internally since we use this module extensively in our CICD pipelines. I am wondering if this project is dead as there hasn't been any activity and none of the pending PR's are being reviewed and merged. I think soon we should look at possibly forking it and maintaining an updated version. I am not a C# developer primarily but given how useful this module is I would be willing to give it a try. Any input from @Dalmirog would be great though!
rickjuryxero
@rickjuryxero

getting Sequence contains no elements error. I have been trying to use octoposh after a long break doing other things. I installed latest module but have errors on both windows and pwsh that are same with some commandlet vs 2018.4.1 version such as get-octopusenvironment (Get-OctopusProject | select -First 2).Count
Get-OctopusProject : Sequence contains no elements
At line:1 char:2

  • (Get-OctopusProject | select -First 2).Count
  • ~~~~~~
    • CategoryInfo : NotSpecified: (:) [Get-OctopusProject], InvalidOperationException
    • FullyQualifiedErrorId : System.InvalidOperationException,Octoposh.Cmdlets.GetOctopusProject

(Get-OctopusMachine | select -First 2).Count
2

(Get-OctopusEnvironment | select -First 2).Count
Get-OctopusEnvironment : Sequence contains no elements
At line:1 char:2

  • (Get-OctopusEnvironment | select -First 2).Count
  • ~~~~~~
    • CategoryInfo : NotSpecified: (:) [Get-OctopusEnvironment], InvalidOperationException
    • FullyQualifiedErrorId : System.InvalidOperationException,Octoposh.Cmdlets.GetOctopusEnvironment

(Get-OctopusUser | select -First 2).Count
2

CialUnity
@CialUnity
hi
i am getting this error:

$VariableSets = Get-OctopusVariableSet -LibrarySetName * -IncludeUsage

OctopusUrl OctopusApiKey


http://octopus.xxx.io API-Dxxxxxxxxxxxxxxxxxxx
Get-OctopusVariableSet : Unable to process response from server: Error converting value "AmazonWebServicesAccount" to type 'Octopus.Client.Model.VariableType'. Path 'Variables[0].Type', line 22, position
40.. Response content: {
"Id": "variableset-LibraryVariableSets-522",
"OwnerId": "LibraryVariableSets-522",
"Versi
At line:6 char:17

  • ... VariableSets = Get-OctopusVariableSet -LibrarySetName * -IncludeUsage
  • ~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Get-OctopusVariableSet], OctopusDeserializationException
    • FullyQualifiedErrorId : Octopus.Client.Exceptions.OctopusDeserializationException,Octoposh.Cmdlets.GetOctopusVariableSet

PS C:\WINDOWS\system32>

any ideas?
CialUnity
@CialUnity
should i make an issue on github, no one seems to be here
Rick
@Rickenbacher
Hi,
I am trying to use Octoposh to get the latest release of my project with the powershell command and I only see empty lines returned on the call from my powershell script.
Set-OctopusConnectionInfo -Server "http://x.x.x.x/octopus" -ApiKey "API-...."
Get-OctopusRelease -ProjectName "ProjectName" -Latest 1
(returns an empty line of output...)
Is this a known issue?
KSchiss
@KSchiss
Hi all - I know that we can use Octoposh to add new environments - can we also add the newly-created Environment to an existing Lifecycle?" thanks in advance for any input!
Larry A
@larryinpdx

Hi all, I'm running into a similar issue as @danielgovier and wondering if anyone else has a workaround?
Get-OctopusDeployment -Environment "Production" returns
Get-OctopusDeployment : Nullable object must have a value.
At line:1 char:1

+ Get-OctopusDeployment -Environment "Production"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-OctopusDeployment], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,Octoposh.Cmdlets.GetOctopusDeployment

whereas Get-OctopusDeployment -Environment "QA" works fine, and if I specify specific project(s) in "Production", Get-OctopusDeployment works fine...Any ideas?

xiaohundan88
@xiaohundan88

I'm having issue removing Library Variable Set. I'm getting below message:

PS C:\projects\Scripts\Octo> $myLVS = Get-OctopusVariableSet -LibrarySetName 'SngTestLibVarSetB'

PS C:\projects\Scripts\Octo> Remove-OctopusResource -Resource $myLVS.Resource
Dunno what to delete

PS C:\projects\Scripts\Octo> $myLVS

ProjectName            : 
LibraryVariableSetName : SngTestLibVarSetB
ID                     : variableset-LibraryVariableSets-9
Variables              : {}
Usage                  : {}
LastModifiedOn         : 1/01/0001 12:00:00 AM
LastModifiedBy         : 
Resource               : Octopus.Client.Model.VariableSetResource

PS C:\projects\Scripts\Octo> Get-OctopusVariableSet -LibrarySetName 'SngTestLibVarSetB' | Remove-OctopusResource
Dunno what to delete

Reading [https://github.com/Dalmirog/OctoPosh/blob/master/Octoposh/Cmdlets/RemoveOctopusResource.cs], it seems that Remove-OctopusResource supports

 case "Octopus.Client.Model.LibraryVariableSetResource":
                            var libraryVariableSet = (LibraryVariableSetResource)r;
                            _connection.Repository.LibraryVariableSets.Delete(libraryVariableSet);
                            WriteObject(true,true);
                            break;

Where $myLVS.Resource is type Octopus.Client.Model.VariableSetResource

PS C:\projects\Scripts\Octo> $myLVS


ProjectName            : 
LibraryVariableSetName : SngTestLibVarSetB
ID                     : variableset-LibraryVariableSets-9
Variables              : {}
Usage                  : {}
LastModifiedOn         : 1/01/0001 12:00:00 AM
LastModifiedBy         : 
Resource               : Octopus.Client.Model.VariableSetResource
pmcevoy
@pmcevoy
Hi there.. I'm trying to use Octoposh inside an AWS lambda and ran into an issue: the .psd1 for the module says that the RootModule is OctoPosh.dll - however I think that AWS lambda is running on a linux host that has case sensitive filesystem. Locally I updated the module to use Octoposh.dll and got further along...
(v 0.6.11)