Skip to content

Commit

Permalink
#423: Added powershell check and handling
Browse files Browse the repository at this point in the history
  • Loading branch information
qngngyn committed Oct 18, 2023
1 parent fef0b17 commit 1e45637
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ATAPAuditor/ATAPAuditor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,18 @@ function Save-ATAPHtmlReport {
$Force
)

#check Powershellversion and handle it
$psVersion = $PSVersionTable.PSVersion
if ($psVersion.Major -ne 5) {
Write-Warning "ATAPAuditor is only compatible with PowerShell Version 5. Your version is $psVersion. Do you want to open a Powershell 5? Y/N"
$in = Read-Host
switch ($in) {
Y {Start Powershell; return}
N {Write-Warning "Stopping Script..."; return}
default {Write-Warning "You did not choose Y nor N. Stopping Script..."; return}
}
}

$parent = $path
if ($Path -match ".html") {
$parent = Split-Path -Path $Path
Expand Down

0 comments on commit 1e45637

Please sign in to comment.