title: Using a switch statement instead of multiple IF's
body: <p>Hi I have the below code and wanted to know the best way to replace it using a switch statement.This example I have 4 possible outcomes but I might end up with over 20 and if statements would get to cluttered .</p>
  
  <pre><code>$Des = "C:\tools\"
  $DListFiles = Get-ChildItem $Des -EA 0
  
  IF((Test-Path $Des)-ne $false -and $DListFiles -eq $null){$DDE = 1}
  ElseIF((Test-Path $Des)-ne $false -and $DListFiles -ne $null){$DDE = 2}
  ElseIF((Test-Path $Des)-eq $false){$DDE = 3}
  Else{$DDE = 4}
  
  write-host "$DDE"
  </code></pre>