Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    HOWTO Get the list of files in Artifact ?

    Scheduled Pinned Locked Moved Support
    3 Posts 2 Posters 14 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      PhilippeC.
      last edited by

      Hello

      I am looking for a simple way to list the files for an Artifact.

      The goal is to deploy (msdeploy) the zip files which are in the Artifact.
      I am trying to use PSEval function but I have pb with scalar or vector type value and I get lost 😧

      The Powershell is very simple :

      (get-childitem $DossierArtifact | where {$_.extension -eq ".zip"}).Name
      

      I wish I had a function like

      @ListFilesInArtifact($ArtifactName,$BuildNumber, $ReleaseaNumber,$filter) 
      

      to make the development easier

      Any help is welcome - Maybe it is the documentraiton, but I did not found it.

      PhilippeC.

      1 Reply Last reply Reply Quote 0
      • rhessingerR Offline
        rhessinger inedo-engineer
        last edited by

        Hi @PhilippeC

        You could create a PowerShell script in BuildMaster and call that from your Otter Script Plan. Here is an example:

        PowerShell Script

        param ([string] $Path, [ref] $ArtifactFiles)
        
        $files = @()
        foreach($name in (get-childitem $Path | where {$_.extension -eq ".zip"}).Name) {
            $files += $name
        }
        $ArtifactFiles = $files
        

        Otter Script Plan:

        Deploy-Artifact Files
        (
            To: target
        );
        
        PSCall AppName::GetZipFiles
        (
            Path: target,
            ArtifactFils => @files
        );
        
        foreach $file in @files
        {
            # Do something with $file
        }
        

        Hope this helps!

        Thanks,
        Rich

        Products Engineer, Inedo

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          PhilippeC. @rhessinger
          last edited by

          Hello Rich
          It is very kind.
          This was exactly what looking for.
          Thanks a lot🤗

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation