-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreat-File-Daily.ps1
More file actions
73 lines (54 loc) · 1.54 KB
/
Creat-File-Daily.ps1
File metadata and controls
73 lines (54 loc) · 1.54 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<#
.SYNOPSIS
Creat-File-Daily
.DESCRIPTION
This task will create file using "yyyy-mm-dd" as the title.
.EXAMPLE
ACreat-File-Daily
.EXAMPLE
Creat-File-Daily -Path "C\Test\" -FileExtension "txt"
.NOTES
Please keep above information
#>
function Creat-File-Daily {
[CmdletBinding()]
param (
[Parameter(HelpMessage="Enter ManagedRuntimeVersion, eg 4.0")][string]$RootPath="C:\Users\niliu\OneDrive\LNDocument\Daily\",
[Parameter(HelpMessage="Enter ManagedPipelineMode, eg 0 or 1")][string]$FileExtension="txt"
)
try{
$FileExtension = (Get-Date -UFormat "%Y-%m-%d")+".txt";
if (!(Test-Path -Path ($RootPath+$FileExtension)))
{
new-item -ItemType file -Path ($RootPath+$FileExtension)
"[8:00-9:00] " >>($RootPath+$FileExtension)
}
notepad.exe ($RootPath+$FileExtension)
}
catch{
}
}
<#
.NOTES
Created on : 2015-05-07
Created by : Liu Ning
.SYNOPSIS
Wrapper function for "svn.exe update"
.DESCRIPTION
Bring the latest changes from the repository into the working copy (HEAD revision).
.EXAMPLE
Update-SvnWorkingCopy -Path C:\Data\LNSvnProject\serviceagentCen
#>
function Update-SvnWorkingCopy {
[CmdletBinding()]
Param (
# The Path parameter identifies the directory of the working copy.
[Parameter(Position=0)]
[String]
$Path="C:\Data\LNSvnProject\serviceagentCen"
)
svn.exe update "$Path"
}
#Example:
Set-Alias -Name udsvnwc -Value Update-SvnWorkingCopy
udsvnwc -Path C:\Data\LNSvnProject\serviceagentCen