Windows: `Touch` Command – Equivalent

The touch command in Linux is used to change a file’s “Access“, “Modify” and “Change” timestamps to the current time and date, but if the file doesn’t exist, the touch command creates it.

If you simply want to create an empty file from the command-line prompt (CMD) or a Windows PowerShell – the type and copy commands can be considered as a Windows touch command equivalent.

The file timestamps in Windows can be changed using the built-in PowerShell commands. (more…)

Windows: Shutdown/Reboot Event IDs – Get Logs

While troubleshooting an issue that causes an unexpected reboot or shutdown of a Windows machine, it is important to know which event IDs are related to system reboot/shutdown and how to find the appropriate logs.

In this note i am publishing all the event IDs related to reboots/shutdowns.

I am also showing how to display the shutdown events with date and time, using a Windows Event Viewer or from the command-line using a PowerShell. (more…)

PowerShell Commands History File Location

The Get-History command in PowerShell lists only the commands entered during the current session, unlike the history command in Linux or MacOS, that returns the full commands history across all sessions.

To get the history of all the previously executed commands in PowerShell it is required to locate the file where these commands are stored.

In this note I’ll show how to locate the history file and get the history of all the previously executed commands in PowerShell. (more…)