DevOpsHandling/Get-DevOpsAllArtifactsFromFeed.ps1
function Get-DevOpsAllArtifactsFromFeed { param ( [Parameter(Mandatory = $false)] [string]$devOpsOrganization = "", [Parameter(Mandatory = $false)] [string]$devOpsFeed = "", [Parameter(Mandatory = $true)] [string]$devOpsArtifact, [Parameter(Mandatory = $false)] [string]$devOpsToken = "", [Parameter(Mandatory = $true)] [string]$destination, [Parameter(Mandatory = $false)] [string]$version ) if ($devOpsOrganization -eq "") { $devOpsOrganization = Get-EnvironmentKeyValue -KeyName "Organization" } if ($devOpsToken -eq "") { $devOpsToken = Get-EnvironmentKeyValue -KeyName "token" } if (!(Test-Path $destination)) { New-Item -Path $destination -ItemType Directory | Out-Null } $dependencies = Get-EnvironmentKeyValue -KeyName "dependencies" if ($devOpsFeed -eq "") { if ($null -ne $dependencies) { if ($dependencies -ne '') { $devOpsFeed = $dependencies[0].devOpsFeed } } } if ($null -ne $dependencies) { $version = $dependencies[0].version } if ($version -ne "") { $version = "{0}.{1}.{2}" -f ([version]$version).Major, ([version]$version).Minor, ([version]$version).Build } else { $version = "*" } if ($devopsFeed -ne "") { Get-DevOpsArtifactsFromFeed -devOpsOrganization $devOpsOrganization -devOpsFeed $devOpsFeed -devOpsArtifact "$($devOpsArtifact)_app" -devOpsToken $devOpsToken -destination $destination -version $version Get-DevOpsArtifactsFromFeed -devOpsOrganization $devOpsOrganization -devOpsFeed $devOpsFeed -devOpsArtifact "$($devOpsArtifact)_runtime" -devOpsToken $devOpsToken -destination $destination -version $version Get-DevOpsArtifactsFromFeed -devOpsOrganization $devOpsOrganization -devOpsFeed $devOpsFeed -devOpsArtifact "$($devOpsArtifact)_tests" -devOpsToken $devOpsToken -destination $destination -version $version } } Export-ModuleMember Get-DevOpsAllArtifactsFromFeed |