forked from mithro/make-env
-
Notifications
You must be signed in to change notification settings - Fork 1
/
touch.ps1
33 lines (29 loc) · 787 Bytes
/
touch.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright (C) 2020 SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
<#
.SYNOPSIS
Creates a file or update modification time.
.PARAMETER path
The parameter path is the file to be created / updated.
.EXAMPLE
Make the C:\random\test123 file
PS C:\> touch C:\random\test123
Update the C:\random\test123 modification time (as it now exists).
PS C:\> touch C:\random\test123
.NOTES
Author: SymbiFlow Authors
License: ISC
#>
param (
[string]$filename
)
if (Test-Path $filename) {
(Get-ChildItem $filename).LastWriteTime = Get-Date
} else {
New-Item -Path $filename -ItemType File | Out-Null
}