Visual Studio automatic time stamp or version number?

Does anyone know of a way to automatically update a version number and/or timestamp in a PowerShell script in Visual Studio (2017)?

It needs to be included in a variable or text string rather than a comment. I’m running in to an issue with automation software sometimes deciding to keep running an old versions of script after an update. I want to add something like “MyScript.PS1 Version x.y.z (yyyy-mm-dd)” output to the top of the script for troubleshooting purposes, and I know that the one time I forget to update the version number will be the time that this issue bites me again.


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

Leave a Reply