79221871

Date: 2024-11-25 06:28:55
Score: 0.5
Natty:
Report link
Class Powershell {
   $version
   Powershell($profile) {

   }

   SetVersion($version) {  try { [ValidateSet(5, 5.1, "5", "5.1", 7, 7.4, "7", "7.4")]$_version = $version}
      catch {
            Write-Host "SetVersion IllegalArgumentException version == $version. See method header for list of valid args -ForegroundColor DarkRed
            Write-Host "Exiting Script..." -ForegroundColor DarkRed
            exit
      }

      *rest of function*
      
   }
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: The-Stanislav