Skip to content

Commit

Permalink
Improved legacy OS compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
akunzai committed Feb 1, 2023
1 parent f754062 commit f466495
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ git pull
Sample output

````markdown
# Windows Secure Auditor: 0.13.4
# Windows Secure Auditor: 0.13.5

## System Information

Expand Down
2 changes: 1 addition & 1 deletion README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ git pull
範例輸出

````markdown
# Windows Secure Auditor: 0.13.4
# Windows Secure Auditor: 0.13.5

## 系統資訊

Expand Down
2 changes: 1 addition & 1 deletion SecureAuditor.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '0.13.4'
ModuleVersion = '0.13.5'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
5 changes: 5 additions & 0 deletions rules/DiskSpace.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ if ($PSUICulture -ne 'en-US') {
}

function Test($config) {
if (-not (Get-Command 'Get-PSDrive' -ErrorAction SilentlyContinue)) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
Write-UnsupportedPlatform($ruleName)
return
}
# https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-psdrive
$drives = Get-PSDrive -PSProvider FileSystem | Where-Object { $null -ne $_.Used -and $_.Used -gt 0 }
$exclude = $config.DiskSpace.Exclude
Expand Down
2 changes: 1 addition & 1 deletion rules/LocalUser/DefaultAccount.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if ($PSUICulture -ne 'en-US') {
}

function Test($config) {
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-LocalUser' -ErrorAction SilentlyContinue)) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
Write-UnsupportedPlatform($ruleName)
return
Expand Down
2 changes: 1 addition & 1 deletion rules/LocalUser/IdleAccount.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ($PSUICulture -ne 'en-US') {
}

function Test($config) {
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-LocalUser' -ErrorAction SilentlyContinue)) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
Write-UnsupportedPlatform($ruleName)
return
Expand Down
2 changes: 1 addition & 1 deletion rules/LocalUser/PasswordExpires.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ($PSUICulture -ne 'en-US') {
}

function Test($config) {
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-LocalUser' -ErrorAction SilentlyContinue)) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
Write-UnsupportedPlatform($ruleName)
return
Expand Down
2 changes: 1 addition & 1 deletion rules/WinEvent/EventLogs.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if ($PSUICulture -ne 'en-US') {

function Test($config) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-WinEvent' -ErrorAction SilentlyContinue)) {
Write-UnsupportedPlatform($ruleName)
return
}
Expand Down
2 changes: 1 addition & 1 deletion rules/WinEvent/Login.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if ($PSUICulture -ne 'en-US') {

function Test($config) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-WinEvent' -ErrorAction SilentlyContinue)) {
Write-UnsupportedPlatform($ruleName)
return
}
Expand Down
2 changes: 1 addition & 1 deletion rules/WinEvent/Shutdown.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ($PSUICulture -ne 'en-US') {

function Test($config) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-WinEvent' -ErrorAction SilentlyContinue)) {
Write-UnsupportedPlatform($ruleName)
return
}
Expand Down
2 changes: 1 addition & 1 deletion rules/WinEvent/SoftwareInstallation.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ($PSUICulture -ne 'en-US') {

function Test($config) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-WinEvent' -ErrorAction SilentlyContinue)) {
Write-UnsupportedPlatform($ruleName)
return
}
Expand Down
2 changes: 1 addition & 1 deletion rules/WinEvent/UserAccountManagement.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if ($PSUICulture -ne 'en-US') {

function Test($config) {
$ruleName = [System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath)
if ($PSVersionTable.PSEdition -eq 'Core' -and $PSVersionTable.Platform -ne 'Win32NT') {
if (-not (Get-Command 'Get-WinEvent' -ErrorAction SilentlyContinue)) {
Write-UnsupportedPlatform($ruleName)
return
}
Expand Down

0 comments on commit f466495

Please sign in to comment.