Touch PowerShell: Create and Update Files Effortlessly The "touch" equivalent in PowerShell is achieved using the `New-Item` cmdlet, which creates a new file or updates the timestamp of an existing file Here’s how you can use it: New-Item -Path 'C:\path\to\your\file txt' -ItemType File -Force This command will create `file txt` if it doesn't exist, or update its timestamp if it does
PowerShell Equivalent to the Linux Command $ gt; touch You can (for the most part) replace the BASH $> touch command with the PowerShell CmdLet $> New-item when creating files in a shell-environment Creating new items works a bit differently in PowerShell than in Linux Shells (I am specifically referring to Bash in this answer)
Touch Command in PowerShell - PhilipMat The two simplest use cases for the touch command are to: Create one or more files, if they don’t exist; Update the access date or modification date of files without changing their content