Skip to content

Review of Get-ADLastBackupDate function #104

@Rapidhands

Description

@Rapidhands

Hi Mike,

By advance, sorry for my english, it's not my mother tongue.

First : one problem identified
Write-Verbose "Last Active Directory backup occurred on $LastBackup! $Result days is less than the alert criteria of $MaxDaysSinceBackup day."
Just locatedf before the If ... else statement ==> useless. The good place is on the else statement.

Suggestion : I've always read "one function, one action".
In this function, 2 actions : Get the ADLastbackupDate (and compare to ref $MaxDaysSinceBackup)
but also Send-MailMessage (New-SlackPost is commented).
I'm thinking that the send-MailMessage should be processed by another function called on condition (i.e. param $mail=$true)

regards
Olivier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions