From f596af90ba4cc25f77c4f7bcc88e8881d22bec04 Mon Sep 17 00:00:00 2001
From: silversword411 <github.com@datmail.com>
Date: Mon, 11 Oct 2021 11:10:56 -0400
Subject: [PATCH] wip fixing downloadurl

---
 scripts_wip/Win_Dell_Command_Install.ps1 | 39 +++++++++++++-----------
 1 file changed, 21 insertions(+), 18 deletions(-)

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