你可以打開使用
start 'C:\Riot Games\League of Legends\LeagueClient.exe'
程序,並得到彈出像...
#First you want to set your variable for the date and time
#Get-ItemProperty is self explanatoy
#select-object gets the LastAccesTime property and -expand isolates that property in a string versus a table
$lastusetime = Get-ItemProperty "C:\Riot Games\League of Legends\LeagueClient.exe" | select-object -expandproperty LastAccessTime
#set the com object for a window and give it a variable
$wshell = New-Object -ComObject Wscript.Shell
#use that variable and the "Pop Up" property of windows shell to set the Windows details. VOID disables any outputs in the powershell window
[void]$wshell.Popup("Last Open $Lastusetime",0,"Program Details",0x1)
要獲得關於Wscript.Shell更多信息對象,你可以去this link
還有其他的方式可以做到這一點,但這是我如何選擇做到這一點。