Skip to content

Commit

Permalink
Split tool name and subfolder name
Browse files Browse the repository at this point in the history
  • Loading branch information
BlythMeister committed May 16, 2024
1 parent 833bbb6 commit 9cb48ea
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Deploy/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ if ([string]::IsNullOrWhiteSpace($ExternalToolDownloadUrl))
else
{
$tools = @(
[pscustomobject]@{Tool='Az-Installer';Version='2.54.0';ExeName='azure-cli.msi';RunExe=$true;RunArgs="/quiet /norestart";OctoAgent=$true}
[pscustomobject]@{Tool='Kube-Linter';Version='0.6.7';ExeName='kube-linter.exe';RunExe=$false;RunArgs="";OctoAgent=$true}
[pscustomobject]@{Tool='Grant';Version='1.01';ExeName='Grant.exe';RunExe=$false;RunArgs="";OctoAgent=$false}
[pscustomobject]@{Tool='Handle';Version='5.0';ExeName='handle.exe';RunExe=$false;RunArgs="";OctoAgent=$false}
[pscustomobject]@{Tool='Handle';Version='5.0';ExeName='handle64.exe';RunExe=$false;RunArgs="";OctoAgent=$false}
[pscustomobject]@{Tool='KubeCtl';Version='1.27.12';ExeName='kubectl.exe';RunExe=$false;RunArgs="";OctoAgent=$true}
[pscustomobject]@{Tool='Az-Installer';SubFolder='Az-Installer';Version='2.54.0';ExeName='azure-cli.msi';RunExe=$true;RunArgs="/quiet /norestart";OctoAgent=$true}
[pscustomobject]@{Tool='Kube-Linter';SubFolder='Kube-Linter';Version='0.6.7';ExeName='kube-linter.exe';RunExe=$false;RunArgs="";OctoAgent=$true}
[pscustomobject]@{Tool='Grant';SubFolder='Grant';Version='1.01';ExeName='Grant.exe';RunExe=$false;RunArgs="";OctoAgent=$false}
[pscustomobject]@{Tool='Handle';SubFolder='Handle';Version='5.0';ExeName='handle.exe';RunExe=$false;RunArgs="";OctoAgent=$false}
[pscustomobject]@{Tool='Handle64';SubFolder='Handle';Version='5.0';ExeName='handle64.exe';RunExe=$false;RunArgs="";OctoAgent=$false}
[pscustomobject]@{Tool='KubeCtl';SubFolder='KubeCtl';Version='1.27.12';ExeName='kubectl.exe';RunExe=$false;RunArgs="";OctoAgent=$true}
)

$tools | ForEach-Object {
if($_.OctoAgent -eq $false -or $OctoAgent -eq $true)
{
$Tool = $_.Tool
$SubFolder = $_.SubFolder
$ExeName = $_.ExeName
$Version = $_.Version

$DownloadUrl = "$ExternalToolDownloadUrl/$Tool/$Version/$ExeName"
$DownloadPath = "$scriptDir\Content\Tools\$Tool\$ExeName"
New-Item -Path "$scriptDir\Content\Tools" -Name $Tool -Type container -Force | Out-Null
$DownloadPath = "$scriptDir\Content\Tools\$SubFolder\$ExeName"
New-Item -Path "$scriptDir\Content\Tools" -Name $SubFolder -Type container -Force | Out-Null

$AlreadyDownloaded = $false

Expand Down

0 comments on commit 9cb48ea

Please sign in to comment.