22 lines
747 B
PowerShell
22 lines
747 B
PowerShell
[CmdletBinding()]
|
|
param()
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
$installerUrl = 'https://github.com/stalwartlabs/cli/releases/latest/download/stalwart-cli-installer.ps1'
|
|
$tempFile = Join-Path ([System.IO.Path]::GetTempPath()) 'stalwart-cli-installer.ps1'
|
|
|
|
try {
|
|
Invoke-WebRequest -Uri $installerUrl -OutFile $tempFile
|
|
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $tempFile
|
|
}
|
|
finally {
|
|
Remove-Item -LiteralPath $tempFile -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Get-Command stalwart-cli -ErrorAction SilentlyContinue) {
|
|
stalwart-cli --version
|
|
}
|
|
else {
|
|
Write-Warning 'stalwart-cli was installed, but the current shell PATH does not include its install directory. Open a new terminal and run stalwart-cli --version.'
|
|
}
|