-
Notifications
You must be signed in to change notification settings - Fork 1
/
Manifest.ps1
70 lines (62 loc) · 2.95 KB
/
Manifest.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#region Copyright & License
# Copyright © 2019 - 2022 François Chabot
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#endregion
#Requires -Modules @{ ModuleName = 'Resource.Manifest' ; ModuleVersion = '2.1.22098.34847' ; MaximumVersion = '2.2.0.0' ; GUID = '07e35b0e-3441-46b4-82e6-d8daafb837bd' }
#Requires -Modules @{ ModuleName = 'BizTalk.Deployment' ; ModuleVersion = '2.1.0.0' ; MaximumVersion = '2.2.0.0' ; GUID = '533b5f59-49ce-4f51-a293-cb78f5cf81b5' }
[CmdletBinding()]
[OutputType([HashTable])]
param(
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[ValidateScript( { Test-Path -Path $_ } )]
[string]
$LogDirectory = 'C:\Files\Logs',
[Parameter(Mandatory = $false)]
[ValidateSet('ALL', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL', 'OFF')]
[string]
$LogLevel = 'DEBUG'
)
Set-StrictMode -Version Latest
$log4netTargetConfigurationFiles = (Join-Path $env:BTSINSTALLPATH BTSNTSvc.exe.log4net.config), (Join-Path $env:BTSINSTALLPATH BTSNTSvc64.exe.log4net.config)
LibraryManifest -Name BizTalk.Factory.Runtime -Description 'BizTalk.Factory''s Comprehensive Set of BizTalk Server Runtime Components.' -Build {
Assembly -Path (Get-ResourceItem -Name log4net) -InstallReference BizTalk.Factory.Runtime
Assembly -Path (Get-ResourceItem -Name Be.Stateless.Extensions,
Be.Stateless.Reflection,
Be.Stateless.Runtime,
Be.Stateless.Security,
Be.Stateless.Stream,
Be.Stateless.Xml,
Be.Stateless.BizTalk.Abstractions,
Be.Stateless.BizTalk.Factory.Logging,
Be.Stateless.BizTalk.Messaging,
Be.Stateless.BizTalk.Pipeline.MicroComponents,
Be.Stateless.BizTalk.ServiceModel,
Be.Stateless.BizTalk.Settings,
Be.Stateless.BizTalk.Stream,
Be.Stateless.BizTalk.Transform.ExtensionObjects,
Be.Stateless.BizTalk.XLang,
Be.Stateless.BizTalk.Xml
)
EventLogSource -Name 'BizTalk.Factory' -LogName Application
File -Path (Get-ResourceItem -Name BTSNTSvc.exe.log4net -Extension .config) `
-Destination $log4netTargetConfigurationFiles
XmlConfigurationAction -Path $log4netTargetConfigurationFiles `
-Update /log4net/appender[@name="'RollingFileAppender'"]/file `
-Attribute @{ value = $(Join-Path $LogDirectory '%property{btshost}.log') }
XmlConfigurationAction -Path $log4netTargetConfigurationFiles `
-Update /log4net/root/level `
-Attribute @{ value = $LogLevel }
XmlConfiguration -Path (Get-ResourceItem -Name BTSNTSvc.exe, machine -Extension .config)
}