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 ) 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 } if ($devOpsFeed -eq "") { $dependencies = Get-EnvironmentKeyValue -KeyName "dependencies" if ($null -ne $dependencies) { $devOpsFeed = $dependencies[0].devOpsFeed } } Get-DevOpsArtifactsFromFeed -devOpsOrganization $devOpsOrganization -devOpsFeed $devOpsFeed -devOpsArtifact "$($devOpsArtifact)_app" -devOpsToken $devOpsToken -destination $destination Get-DevOpsArtifactsFromFeed -devOpsOrganization $devOpsOrganization -devOpsFeed $devOpsFeed -devOpsArtifact "$($devOpsArtifact)_runtime" -devOpsToken $devOpsToken -destination $destination Get-DevOpsArtifactsFromFeed -devOpsOrganization $devOpsOrganization -devOpsFeed $devOpsFeed -devOpsArtifact "$($devOpsArtifact)_tests" -devOpsToken $devOpsToken -destination $destination } Export-ModuleMember Get-DevOpsAllArtifactsFromFeed |