Best way to show date/time a script is executed within script output

I need to run the following Azure Powershell cmdlet to show a list of users:

get-azurermroleassignment | select DisplayName,SignInName,ObjectType,RoleDefinitionName 

I also need to have, within the output of the script, a date and time stamp.

If I just run [datetime]::Today, I get today’s date, but the time is 12:00:00 AM. That’s definitely not the current time.

Is there some way for me to include this?

submitted by /u/MohnJaddenPowers
[link] [comments]

Leave a Reply