wip fixing downloadurl
-$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'
@@ -11,12 +11,14 @@ If (Test-Path -Path $SourceInstallFile -PathType Leaf) {
Wait-Process -InputObject $proc
if ($proc.ExitCode -ne 0) {
Write-Warning "Exited with error code: $($proc.ExitCode)"
- }else{
+ }
+ else {
Write-Output "Successful install with exit code: $($proc.ExitCode)"
}
-}else{
+}
+else {
New-Item -Path $SourceDownloadLocation -ItemType directory
Invoke-WebRequest $Source -OutFile $SourceInstallFile
@@ -25,7 +27,8 @@ If (Test-Path -Path $SourceInstallFile -PathType Leaf) {
Wait-Process -InputObject $proc
if ($proc.ExitCode -ne 0) {
Write-Warning "Exited with error code: $($proc.ExitCode)"
- }else{
+ }
+ else {
Write-Output "Successful install with exit code: $($proc.ExitCode)"
}
}
\ No newline at end of file
