CmdLets/Confirm-PreReq.ps1

Function Confirm-PreReq 
 {

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true)][String]$PreReq,
        [Parameter(Mandatory=$true)][Boolean]$Package
    )
    if (!$Package){
        if (get-module -name $PreReq -ListAvailable){
            Write-Host "PreReq found: $PreReq"
            return $True
        }
        else { 
            Write-Host "PreReq not found: $PreReq"
            return $False
        }
    } else {
        if ((get-package | where-object -property name -eq $PreReq)) { 
            Write-Host "PreReq found: $PreReq"
            return $True
        } else { 
            Write-Host "PreReq not found: $PreReq"
            return $False
        }
    }

}