diff --git a/install_maven3.ps1 b/install_maven3.ps1 new file mode 100644 index 00000000..a83f0d9b --- /dev/null +++ b/install_maven3.ps1 @@ -0,0 +1,42 @@ +# Check for UAC elevation +if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) +{ + Write-Host "The script requires elevated permissions to run. Please run as administrator." + Write-Host "Press any key to exit." + [System.Console]::ReadKey($true) + exit +} + +# Download and install the latest version of Maven +$lines = Invoke-WebRequest -Uri "https://maven.apache.org/download.cgi" -UseBasicParsing +foreach ($line in $lines) { + if ($line -match 'maven') { + if ($line -match '-bin.zip') { + $version = ($line -split '