Inital commit.

This commit is contained in:
Shady Ibraheem
2019-11-15 15:23:41 -05:00
parent a8289fbefa
commit f396818e23
208 changed files with 10770 additions and 95 deletions

View File

@@ -0,0 +1,83 @@
function Install-MSI
{
Param
(
[String]$MsiUrl,
[String]$MsiName
)
$exitCode = -1
try
{
Write-Host "Downloading $MsiName..."
$FilePath = "${env:Temp}\$MsiName"
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
Write-Host "Starting Install $MsiName..."
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
$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
}
}
catch
{
Write-Host -Object "Failed to install the MSI $MsiName"
Write-Host -Object $_.Exception.Message
exit -1
}
}
function Install-EXE
{
Param
(
[String]$Url,
[String]$Name,
[String[]]$ArgumentList
)
$exitCode = -1
try
{
Write-Host "Downloading $Name..."
$FilePath = "${env:Temp}\$Name"
Invoke-WebRequest -Uri $Url -OutFile $FilePath
Write-Host "Starting Install $Name..."
$process = Start-Process -FilePath $FilePath -ArgumentList $ArgumentList -Wait -PassThru
$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."
return $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Executable $Name"
Write-Host -Object $_.Exception.Message
return -1
}
}