Skip to content

YoraiLevi/ahk-autohotkeys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

$user = "YoraiLevi"
$project = "autohotkeys"
$artifacts = @("main.exe", 'BaseRemap.exe', 'Vivobook_ASUSLaptop TP412FAC_TP412FA.exe')
$latestRelease = Invoke-WebRequest "https://github.com/$user/$project/releases/latest" -Headers @{"Accept"="application/json"}
$json = $latestRelease.Content | ConvertFrom-Json
$latestVersion = $json.tag_name
foreach ($artifact in $artifacts) {
    $artifact = $artifact -replace " ", "."
    $url = "https://github.com/$user/$project/releases/download/$latestVersion/$artifact"
    # $path = [Environment]::GetFolderPath(([Environment+SpecialFolder]::Startup))
    $path = $ENV:UserProfile+"\"+"bin"; mkdir -p $path -ErrorAction SilentlyContinue
    $file_path = $path+"\"+$artifact
    Write-Information "Downloading $artifact to $file_path"
    Invoke-WebRequest -Uri $url -OutFile $file_path
    Stop-Process -Name main.exe -ErrorAction SilentlyContinue
    Start-Process $file_path
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages