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 ?
-
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 lostThe 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.
-
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
-
Hello Rich
It is very kind.
This was exactly what looking for.
Thanks a lot