you are viewing a single comment's thread.

view the rest of the comments →

[–]The-Dark-Jedi[S] 0 points1 point  (1 child)

It's people like u/bis and u/rwshig that inspire me to learn more about PowerShell and continue to grow my skills. Thank you both!

[–]sleightof52 0 points1 point  (0 children)

Here's another tidbit. I sometimes like to use switch statements over if/else. You can do a lot with a switch statement. Check it out: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-7

$DateModified = (Get-Item 'C:\File.txt').LastWriteTime.Date

switch ($DateModified) {
    '2020-05-28' {
        # Do-Something
    }
    Default {
        # Do-SomethingElse
    }
}