Add Powershell Modules & NuGet Repo/Get-Installer_List_Artifactory.ps1
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<#
|
||||
Author: Gabe Kerntke
|
||||
Date: 05-06-2026
|
||||
|
||||
.Synopsis
|
||||
Function lists installers from Artifactory
|
||||
|
||||
.Modified
|
||||
2026-05-06 (GabeK) - Original script created
|
||||
2026-05-26 (GabeK) - Script updated to use invoke-restmethod instead
|
||||
#>
|
||||
|
||||
Set-StrictMode -Version 2.0
|
||||
|
||||
#Lists installers from Artifactory
|
||||
Function Get-Installer_List_Artifactory {
|
||||
$Artifactory_Full_Path = "$Artifactory_URL/api/storage$Artifactory_Installer_Path"
|
||||
|
||||
# Show files only
|
||||
Invoke-RestMethod -Uri $Artifactory_Full_Path -Credential $Creds | Select-Object -ExpandProperty children |
|
||||
Select-Object -ExpandProperty uri | Sort-Object -Descending | Select-Object -First 1
|
||||
}
|
||||
|
||||
### Seems overkill so commented out
|
||||
#Function to test if installer can be downloaded from Artifactory
|
||||
# Function Test-Installer_URL {
|
||||
# $Download_URL = $Artifactory_URL + $Artifactory_Installer_Path + $Installer_Name
|
||||
# $Download_URL_Test = Invoke-WebRequest $Download_URL -Credential $Creds | Select-Object -ExpandProperty StatusCode
|
||||
# If ($Download_URL_Test -eq "200") {
|
||||
# Write-Output $true
|
||||
# }
|
||||
# Else {
|
||||
# Write-Output "Artifactory missing Package"
|
||||
# }
|
||||
# }
|
||||
Reference in New Issue
Block a user