wip fixing downloadurl

This commit is contained in:
silversword411 2021-10-11 11:10:56 -04:00
parent aff659b6b6
commit f596af90ba
No known key found for this signature in database
GPG Key ID: 6F4BD176F56B50CA
1 changed files with 21 additions and 18 deletions

View File

@ -1,31 +1,34 @@
$Source = "https://davidthegeek.com/utils/dell/DCU_4.3.0.EXE"
$Source = "$downloadurl"
$SourceDownloadLocation = "C:\temp\Dell_Command_Update_4.3"
$SourceInstallFile = "$SourceDownloadLocation\DCU_Setup_4_3_0.exe"
$ProgressPreference = 'SilentlyContinue'
If (Test-Path -Path $SourceInstallFile -PathType Leaf) {
$proc = Start-Process "$SourceInstallFile" -ArgumentList "/s" -PassThru
Wait-Process -InputObject $proc
if ($proc.ExitCode -ne 0) {
Write-Warning "Exited with error code: $($proc.ExitCode)"
}else{
Write-Output "Successful install with exit code: $($proc.ExitCode)"
}
$proc = Start-Process "$SourceInstallFile" -ArgumentList "/s" -PassThru
Wait-Process -InputObject $proc
if ($proc.ExitCode -ne 0) {
Write-Warning "Exited with error code: $($proc.ExitCode)"
}
else {
Write-Output "Successful install with exit code: $($proc.ExitCode)"
}
}else{
}
else {
New-Item -Path $SourceDownloadLocation -ItemType directory
Invoke-WebRequest $Source -OutFile $SourceInstallFile
New-Item -Path $SourceDownloadLocation -ItemType directory
Invoke-WebRequest $Source -OutFile $SourceInstallFile
$proc = Start-Process "$SourceInstallFile" -ArgumentList "/s" -PassThru
Wait-Process -InputObject $proc
if ($proc.ExitCode -ne 0) {
Write-Warning "Exited with error code: $($proc.ExitCode)"
}else{
Write-Output "Successful install with exit code: $($proc.ExitCode)"
}
$proc = Start-Process "$SourceInstallFile" -ArgumentList "/s" -PassThru
Wait-Process -InputObject $proc
if ($proc.ExitCode -ne 0) {
Write-Warning "Exited with error code: $($proc.ExitCode)"
}
else {
Write-Output "Successful install with exit code: $($proc.ExitCode)"
}
}