I would like to install as part of requirement varigent Biml studio software on windows server 2019 through powershell. i have devloped the below script to download and install on go, but it does not install the required build target files, could some one help me to install all the required packages
$ErrorActionPreference = 'Stop';
$val = C:\Users\v-dbillakurt\Downloads\common\common\CloudTest-Common.ps1
function log([string]$message) {
Write-Host "[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] $message";
}
function DownloadFile ($fileUrl, $downloadFileName, [bool]$useBitsTransfer=$false) { # use false, as BitsTransfer not supported in 1ES Image Factory
$downloadFilePath="C:\Common$downloadFileName";
log "Download [$fileUrl]->[$downloadFilePath];";
if([IO.File]::Exists($downloadFilePath) -and "$env:ForceDownloadFile" -ne 'true') {
log "Download skipped. File exists. set ForceDownloadFile=true to force download";
return $downloadFilePath;
}
$start_time = Get-Date;
if($useBitsTransfer) {
Import-Module BitsTransfer;
Start-BitsTransfer -Source $fileUrl -Destination $downloadFilePath -RetryInterval 60 -RetryTimeout 180;
}
else {
(New-Object System.Net.WebClient).DownloadFile($fileUrl, $downloadFilePath);
}
log "Download completed. Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s);";
return $downloadFilePath;
}
function Install-BIML {
$url = "https://varigence.com/downloads/bimlstudiosetup.exe";
# Downloads SQL BIML to temp dir
$file = DownloadFile $url 'bimlstudiosetup.exe';
$logFile = "C:\Common\BIML-install-$((New-Guid).Guid).log";
#$arguments = "/bimlstudiosetup.exe -s -InstallFeature:BimlStudio_X64/install /quiet /norestart /log $logFile";
#$arguments = ".\bimlstudiosetup.exe -s -WixBundleProviderKey 46a2e90b-6027-4c68-91b3-55ee468461d1 -InstallFeature:BimlStudio_X64/install /quiet /norestart /log $logFile";
$arguments = "start /wait bimlstudiosetup.exe -s -InstallFeature:BimlStudio_X64";
#$arguments = "/install INSTALLALL /quiet /norestart /log $logFile";
# install BIML
Write-Host 'Installing BIML';
Write-Host "Command: $file $arguments";
$process = Start-Process $file -ArgumentList $arguments -Wait -NoNewWindow -passthru;
Write-host "Done!" -f Green
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
exit $exitCode
}
# display logs
if([IO.File]::Exists($logFile)) { $logs = [IO.File]::ReadAllText($logFile); }
if(!$logs -or !$logs.Contains('All specified components have been installed successfully') -or !$logs.Contains('Exit code: 0x0')) {
if($logs) {
$logsTrimmed = $logs.Substring([Math]::Max($logs.Length - 30000, 0));
}
Write-Host "---------------- Trimmed logs ---------------- : $logsTrimmed";
throw 'setup was not successful';
}
Write-Host "Install Done.";
}
Install-BIML;