diff --git a/scripts_wip/Win_Dell_Command_Install.ps1 b/scripts_wip/Win_Dell_Command_Install.ps1 index 89f81cae..2ef13a57 100644 --- a/scripts_wip/Win_Dell_Command_Install.ps1 +++ b/scripts_wip/Win_Dell_Command_Install.ps1 @@ -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)" + } } \ No newline at end of file