mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-02-17 12:37:30 +00:00
installer/build.ps1: autoformat
This commit is contained in:
parent
191debeed6
commit
cede267565
@ -1,11 +1,11 @@
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[Parameter(Mandatory = $true)]
|
||||
[String] $PathToExecutable,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[Parameter(Mandatory = $true)]
|
||||
[String] $Version,
|
||||
[Parameter(Mandatory=$false)]
|
||||
[ValidateSet("amd64","386")]
|
||||
[Parameter(Mandatory = $false)]
|
||||
[ValidateSet("amd64", "386")]
|
||||
[String] $Arch = "amd64"
|
||||
)
|
||||
$ErrorActionPreference = "Stop"
|
||||
@ -30,7 +30,7 @@ function Get-FileIfNotExists {
|
||||
$Url,
|
||||
$Destination
|
||||
)
|
||||
if(-not (Test-Path $Destination)) {
|
||||
if (-not (Test-Path $Destination)) {
|
||||
Write-Verbose "Downloading $Url"
|
||||
$wc.DownloadFile($Url, $Destination)
|
||||
}
|
||||
@ -40,7 +40,7 @@ function Get-FileIfNotExists {
|
||||
}
|
||||
|
||||
$sourceDir = mkdir -Force Source
|
||||
mkdir -Force Work,Output | Out-Null
|
||||
mkdir -Force Work, Output | Out-Null
|
||||
|
||||
Write-Verbose "Downloading WiX..."
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
@ -51,7 +51,7 @@ Expand-Archive -Path "${sourceDir}\wix-binaries.zip" -DestinationPath WiX -Force
|
||||
Copy-Item -Force $PathToExecutable Work/wmi_exporter.exe
|
||||
|
||||
Write-Verbose "Creating wmi_exporter-${Version}-${Arch}.msi"
|
||||
$wixArch = @{"amd64"="x64"; "386"="x86"}[$Arch]
|
||||
$wixArch = @{"amd64" = "x64"; "386" = "x86"}[$Arch]
|
||||
$wixOpts = "-ext WixFirewallExtension"
|
||||
Invoke-Expression "WiX\candle.exe -nologo -arch $wixArch $wixOpts -out Work\wmi_exporter.wixobj -dVersion=`"$Version`" wmi_exporter.wxs"
|
||||
Invoke-Expression "WiX\light.exe -nologo -spdb $wixOpts -out `"Output\wmi_exporter-${Version}-${Arch}.msi`" Work\wmi_exporter.wixobj"
|
||||
|
Loading…
Reference in New Issue
Block a user