There is Start-Trascript
which logs all the commands you entered. More in official documentation: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-6
The full output of the example trace is
**********************
Windows PowerShell transcript start
Start time: 20190322104506
Username: DOMAIN\user
RunAs User: DOMAIN\user
Configuration Name:
Machine: MAICHINE_NAME (Microsoft Windows NT 10.0.17763.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 31428
PSVersion: 5.1.17763.316
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17763.316
BuildVersion: 10.0.17763.316
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is C:\transcripts\transcript0.txt
C:\projects\> ls
Directory: C:\projects\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 03/01/2019 16:07 X
d----- 18/02/2019 16:56 Y
d----- 21/03/2019 15:49 Z
d----- 22/03/2018 16:17 T
C:\projects\> cat .\paket.lock
STORAGE: NONE
C:\projects\> Stop-Transcript
**********************
Windows PowerShell transcript end
End time: 20190322104539
**********************