Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions powershell/install-cloudbase-init-windows.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Installs 64-bit Cloudbase-init on Microsoft Windows system

$cloudbaseInitVersion = "1.1.2"


### DO NOT EDIT BEYOND HERE ###

$cloudbaseInitVersionUnderscore = $cloudbaseInitVersion.replace(".","_")
$cloudbaseInitInstallerUri = "https://github.com/cloudbase/cloudbase-init/releases/download/${cloudbaseInitVersion}/CloudbaseInitSetup_${cloudbaseInitVersionUnderscore}_x64.msi"
$cloudbaseInitInstaller = Split-Path $cloudbaseInitInstallerUri -Leaf
$githubLatestReleases = 'https://api.github.com/repos/cloudbase/cloudbase-init/releases/latest'

$releases = Invoke-WebRequest $githubLatestReleases | ConvertFrom-Json

$latestx64release = $releases.assets | ? {$_.name -like '*x64.msi'}

$cloudbaseInitInstallerUri = $latestx64release.browser_download_url

$cloudbaseInitInstaller = $latestx64release.name

$cloudbaseInitInstallPath = "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\"
$cloudbaseInitConfigFile = "cloudbase-init.conf"
Expand Down Expand Up @@ -84,4 +90,4 @@ Write-Host "Enabling automatic startup for Cloudbase-init ..."
Get-Service -Name cloudbase-init | Set-Service -StartupType Automatic

Write-Host "Cleaning up Cloudbase-Init installer ..."
Remove-Item C:\$cloudbaseInitInstaller -Confirm:$false
Remove-Item C:\$cloudbaseInitInstaller -Confirm:$false