Skip to content

Commit

Permalink
Code Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Apr 9, 2024
1 parent 1c3d366 commit 1f614e9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions Src/Private/Get-AbrWinDHCPInfrastructure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrWinDHCPInfrastructure {
.DESCRIPTION
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.5.2
Version: 0.5.4
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -40,15 +40,15 @@ function Get-AbrWinDHCPInfrastructure {
'Dynamic Bootp' = ConvertTo-TextYN $Settings.DynamicBootp
'Database Path' = ConvertTo-EmptyToFiller $Database.FileName
'Database Backup Path' = ConvertTo-EmptyToFiller $Database.BackupPath
'Database Backup Interval' = switch ($Database.BackupInterval) {
"" { "--"; break }
$NULL { "--"; break }
default { "$($Database.BackupInterval) min" }
'Database Backup Interval' = switch ([string]::IsNullOrEmpty($Database.BackupInterval)) {
$true { "--" }
$false { "$($Database.BackupInterval) min" }
default { 'Unknown' }
}
'Database Logging Enabled' = Switch ($Database.LoggingEnabled) {
"" { "--"; break }
$Null { "--"; break }
default { ConvertTo-TextYN $Database.LoggingEnabled }
'Database Logging Enabled' = Switch ([string]::IsNullOrEmpty($Database.LoggingEnabled)) {
$true { "--" }
$false { ConvertTo-TextYN $Database.LoggingEnabled }
default { 'Unknown' }
}
'User Name' = ConvertTo-EmptyToFiller $DNSCredential.UserName
'Domain Name' = ConvertTo-EmptyToFiller $DNSCredential.DomainName
Expand Down
10 changes: 5 additions & 5 deletions Src/Private/Get-AbrWinDNSInfrastructure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrWinDNSInfrastructure {
.DESCRIPTION
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.5.2
Version: 0.5.4
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -112,10 +112,10 @@ function Get-AbrWinDNSInfrastructure {
'NoRefresh Interval' = ConvertTo-EmptyToFiller $DNSSetting.NoRefreshInterval
'Refresh Interval' = ConvertTo-EmptyToFiller $DNSSetting.RefreshInterval
'Scavenging Interval' = ConvertTo-EmptyToFiller $DNSSetting.ScavengingInterval
'Last Scavenge Time' = Switch ($DNSSetting.LastScavengeTime) {
"" { "--"; break }
$Null { "--"; break }
default { ConvertTo-EmptyToFiller ($DNSSetting.LastScavengeTime.ToString("MM/dd/yyyy")) }
'Last Scavenge Time' = Switch ([string]::IsNullOrEmpty($DNSSetting.LastScavengeTime)) {
$true { "--" }
$false { ConvertTo-EmptyToFiller ($DNSSetting.LastScavengeTime.ToString("MM/dd/yyyy")) }
default { 'Unknown' }
}
'Scavenging State' = Switch ($DNSSetting.ScavengingState) {
"True" { "Enabled" }
Expand Down
10 changes: 5 additions & 5 deletions Src/Private/Get-AbrWinDNSZone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrWinDNSZone {
.DESCRIPTION
Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.5.2
Version: 0.5.4
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -195,10 +195,10 @@ function Get-AbrWinDNSZone {
'Aging Enabled' = ConvertTo-EmptyToFiller (ConvertTo-TextYN $Settings.AgingEnabled)
'Refresh Interval' = ConvertTo-EmptyToFiller $Settings.RefreshInterval
'NoRefresh Interval' = ConvertTo-EmptyToFiller $Settings.NoRefreshInterval
'Available For Scavenge' = Switch ($Settings.AvailForScavengeTime) {
"" { "--"; break }
$Null { "--"; break }
default { (ConvertTo-EmptyToFiller ($Settings.AvailForScavengeTime).ToUniversalTime().toString("r")); break }
'Available For Scavenge' = Switch ([string]::IsNullOrEmpty($Settings.AvailForScavengeTime)) {
$true { "--" }
$false { (ConvertTo-EmptyToFiller ($Settings.AvailForScavengeTime).ToUniversalTime().toString("r")) }
default { 'Unknown' }
}
}
$OutObj += [pscustomobject]$inobj
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrWinLocalAdmin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function Get-AbrWinLocalAdmin {
$TempLocalAdminsReport = [PSCustomObject]@{
'Account Name' = $LocalAdmin.Name
'Account Type' = $LocalAdmin.ObjectClass
'Account Source' = $LocalAdmin.PrincipalSource
'Account Source' = ConvertTo-EmptyToFiller $LocalAdmin.PrincipalSource
}
$LocalAdminsReport += $TempLocalAdminsReport
} catch {
Expand Down

0 comments on commit 1f614e9

Please sign in to comment.