FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NLog.MailKit/patchFileVersion.ps1 at master · tmstar/NLog.MailKit · GitHub
tmstar
/
NLog.MailKit
Public
forked from
NLog/NLog.MailKit
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
NLog.MailKit
/
patchFileVersion.ps1
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (28 loc) · 929 Bytes
Breadcrumbs
NLog.MailKit
/
patchFileVersion.ps1
Copy path
File metadata and controls
42 lines (28 loc) · 929 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
param
([
string
]
$filewildCard
,
[
string
]
$version
)
#
returns FileInfo
function
findFile
([
string
]
$filewildCard
) {
$files
=
@
(
Get-ChildItem
$filewildCard
-
Recurse);
if
(
$files
.Length
-gt
1
) {
throw
"
Found
$
(
$files
.length
)
files. Stop, we need an unique pattern
"
}
if
(
$files
.Length
-eq
0
) {
throw
"
Find not found with pattern
$filewildCard
. Stop
"
}
return
$files
[
0
];
}
function
patchAssemblyFileVersion
([
System.IO.FileInfo
]
$file
,
[
string
]
$version
) {
$xmlPath
=
$file
.FullName
;
$xml
=
[
xml
](
get-content
$xmlPath
)
$propertyGroup
=
$xml
.Project.PropertyGroup
Write-Host
"
patch
$xmlPath
to
$version
"
#
FileVersion = AssemblyFileVersionAttribute
$propertyGroup
[
0
].FileVersion
=
$version
$xml
.Save
(
$xmlPath
)
}
$file
=
findFile
$filewildCard
-
ErrorAction Stop
patchAssemblyFileVersion
$file
$version
-
ErrorAction Stop
trap
{
write-output
$_
exit
1
}
Back
|
FazBrowse Home
|
New Git URL