PowerTip: Create Self-Updating Variable

Summary: Learn how to create a self-updating variable.  How can I create a variable that will automatically update when I call it?  Use Set-PSBreakPoint to set a variable that will always have the current date and time (or only time): Set-PSBreakpoint -Variable Time -Mode Read -Action {$Global:Time=(Get-Date).ToShortTimeString();$Global:Time} $Time Set-PSBreakpoint -Variable Date -Mode Read -Action {$Global:Date=Get-Date;$Global:Date} $Date Note  You…