Code: Select all
I developed an application in PowerShell with windows Forms.
I would like to make a condition for the executable to expire on the date I determine.
I made this condition in another application that I developed in VB.NET, but I didn't find how to do it in power shell
in VB it looked like this:
Dim dt1 = DateTime.Now
Dim dt2 = DateTime.Parse("30/09/2019")
If dt1 >= dt2 Then
MsgBox("Expired Date - Please Contact Administrator")
Does anyone know how I do this in powerShell? no need to have msgbox, just want the program not to run, not open, do nothing when it arrives on the set date
Thank you very much in advance.