This repository has been archived by the owner on Dec 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathextensions.ps1
55 lines (48 loc) · 1.64 KB
/
extensions.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This script is derived from the dotless build script.
function Generate-Assembly-Info
{
param(
[string]$file = $(throw "file is a required parameter."),
[string]$title,
[string]$description,
[string]$product,
[string]$copyright,
[string]$version
)
$assemblyInfo =
"//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by the build system.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle(""$title"")]
[assembly: AssemblyDescription(""$description"")]
[assembly: AssemblyProduct(""$product"")]
[assembly: AssemblyCopyright(""$copyright"")]
[assembly: AssemblyVersion(""$version"")]
[assembly: AssemblyInformationalVersion(""$version"")]
[assembly: AssemblyFileVersion(""$version"")]
[assembly: AssemblyDelaySign(false)]"
Generate-File-Content `
-file $file `
-content $assemblyInfo
}
function Generate-File-Content
{
param(
[string]$file = $(throw "file is a required parameter."),
[string]$content = $(throw "content is a required parameter.")
)
$dir = [System.IO.Path]::GetDirectoryName($file)
if ([System.IO.Directory]::Exists($dir) -eq $false)
{
[System.IO.Directory]::CreateDirectory($dir)
}
Out-File -FilePath $file -Encoding UTF8 -InputObject $content
}