From 62826facb3f0ed1a90863bae86fa2762ab17b280 Mon Sep 17 00:00:00 2001 From: Gabe Date: Wed, 1 Jul 2026 18:55:46 +0000 Subject: [PATCH] Add Powershell Modules & NuGet Repo/Get-Installer_List_Artifactory.ps1 --- .../Get-Installer_List_Artifactory.ps1 | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Powershell Modules & NuGet Repo/Get-Installer_List_Artifactory.ps1 diff --git a/Powershell Modules & NuGet Repo/Get-Installer_List_Artifactory.ps1 b/Powershell Modules & NuGet Repo/Get-Installer_List_Artifactory.ps1 new file mode 100644 index 0000000..c9b2a73 --- /dev/null +++ b/Powershell Modules & NuGet Repo/Get-Installer_List_Artifactory.ps1 @@ -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" +# } +# } \ No newline at end of file