Skip to content

Commit 828583f

Browse files
Release Version 1.0.2.1
resolve issue #7 - Fix New-WELCEventChannelManifest: Fix bug on Windows PowerShell (5.1) with creating manifest. Compiling manifest files into DLLs is possible, now.
2 parents 7595cd8 + a77f626 commit 828583f

File tree

3 files changed

+44
-30
lines changed

3 files changed

+44
-30
lines changed

WinEventLogCustomization/WinEventLogCustomization.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RootModule = 'WinEventLogCustomization.psm1'
44

55
# Version number of this module.
6-
ModuleVersion = '1.0.2'
6+
ModuleVersion = '1.0.2.1'
77

88
# ID used to uniquely identify this module
99
GUID = '9268705a-75d5-401c-b13d-4d1a8f380b17'

WinEventLogCustomization/changelog.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Changelog
2+
## 1.0.2.1 (2022-09-29)
3+
- New: ---
4+
- Upd: ---
5+
- Fix:
6+
- New-WELCEventChannelManifest: Fix bug on Windows PowerShell (5.1) with creating manifest. Compiling manifest files into DLLs is possible, now.
7+
28
## 1.0.2 (2022-09-24)
39
- New: ---
410
- Upd:
5-
- Unregister-WELCEventChannelManifest: Extend deregistration process with scanning registry for provider/ event source artifacts on channels from manifest that is going to unregister
11+
- Unregister-WELCEventChannelManifest: Extend deregistration process with scanning registry for provider/ event source artifacts on channels from manifest that is going to unregister
612
- Fix:
713
- New-WELCEventChannelManifest: make WhatIf switch effective on command
814
- Set-WELCEventChannel: bugfix hashtable value mistake, that prevent you from using the function

WinEventLogCustomization/functions/New-WELCEventChannelManifest.ps1

+36-28
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,15 @@
496496
Write-PSFMessage -Level Debug -Message "Generate '$($fileName).h', '$($fileName).rc' and '$($fileName)TEMP.BIN' files from xml manifest"
497497
$tempFilesExpected = @("$($TempPath)\$($fileName).h", "$($TempPath)\$($fileName).rc", "$($TempPath)\$($fileName)TEMP.BIN")
498498
$tempFilesExpected | Get-ChildItem -ErrorAction SilentlyContinue | Remove-Item -Force -Confirm:$false
499-
Start-Process `
500-
-FilePath "$($CompilationToolPath)\mc.exe" `
501-
-ArgumentList $fullNameManifestTemp `
502-
-WorkingDirectory $TempPath `
503-
-NoNewWindow `
504-
-Wait `
505-
-WhatIf:$false
499+
$paramExecute = @{
500+
FilePath = "$($CompilationToolPath)\mc.exe"
501+
ArgumentList = $fullNameManifestTemp
502+
WorkingDirectory = $TempPath
503+
NoNewWindow = $true
504+
Wait = $true
505+
}
506+
if ($PSEdition -like "Core") { $paramExecute.Add("WhatIf", $false) }
507+
Start-Process @paramExecute
506508

507509
Write-PSFMessage -Level Debug -Message "Validating generated files"
508510
foreach ($tempFile in $tempFilesExpected) {
@@ -519,13 +521,15 @@
519521
Write-PSFMessage -Level Debug -Message "Generate '$($fileName).cs' file from xml manifest"
520522
$tempFilesExpected = @( "$($TempPath)\$($fileName).cs" )
521523
$tempFilesExpected | Get-ChildItem -ErrorAction SilentlyContinue | Remove-Item -Force -Confirm:$false
522-
Start-Process `
523-
-FilePath "$($CompilationToolPath)\mc.exe" `
524-
-ArgumentList "-css NameSpace $($fullNameManifestTemp)" `
525-
-WorkingDirectory $TempPath `
526-
-NoNewWindow `
527-
-Wait `
528-
-WhatIf:$false
524+
$paramExecute = @{
525+
FilePath = "$($CompilationToolPath)\mc.exe"
526+
ArgumentList = "-css NameSpace $($fullNameManifestTemp)"
527+
WorkingDirectory = $TempPath
528+
NoNewWindow = $true
529+
Wait = $true
530+
}
531+
if ($PSEdition -like "Core") { $paramExecute.Add("WhatIf", $false) }
532+
Start-Process @paramExecute
529533

530534
Write-PSFMessage -Level Debug -Message "Validating generated '$($fileName).cs' file"
531535
foreach ($tempFile in $tempFilesExpected) {
@@ -542,13 +546,15 @@
542546
Write-PSFMessage -Level Debug -Message "Generate '$fileName).res' file from '$($fileName).rc' file"
543547
$tempFilesExpected = @("$($TempPath)\$($fileName).res")
544548
$tempFilesExpected | Get-ChildItem -ErrorAction SilentlyContinue | Remove-Item -Force -Confirm:$false
545-
Start-Process `
546-
-FilePath "$($CompilationToolPath)\rc.exe" `
547-
-ArgumentList "$($fileName).rc" `
548-
-WorkingDirectory $TempPath `
549-
-Wait `
550-
-WindowStyle Hidden `
551-
-WhatIf:$false
549+
$paramExecute = @{
550+
FilePath = "$($CompilationToolPath)\rc.exe"
551+
ArgumentList = "$($fileName).rc"
552+
WorkingDirectory = $TempPath
553+
Wait = $true
554+
WindowStyle = "Hidden"
555+
}
556+
if ($PSEdition -like "Core") { $paramExecute.Add("WhatIf", $false) }
557+
Start-Process @paramExecute
552558

553559
Write-PSFMessage -Level Debug -Message "Validating generated '$($fileName).res' file"
554560
foreach ($tempFile in $tempFilesExpected) {
@@ -563,13 +569,15 @@
563569

564570
#region final compilation of the dll file
565571
Write-PSFMessage -Level Debug -Message "Finally compiling '$fileName).dll' file from generated meta files"
566-
Start-Process `
567-
-FilePath "$($WindowsCSCPath)\csc.exe" `
568-
-ArgumentList "/win32res:$($TempPath)\$($fileName).res /unsafe /target:library /out:$($TempPath)\$($fileName).dll $($TempPath)\$($fileName).cs" `
569-
-WorkingDirectory $TempPath `
570-
-Wait `
571-
-WindowStyle Hidden `
572-
-WhatIf:$false
572+
$paramExecute = @{
573+
FilePath = "$($WindowsCSCPath)\csc.exe"
574+
ArgumentList = "/win32res:$($TempPath)\$($fileName).res /unsafe /target:library /out:$($TempPath)\$($fileName).dll $($TempPath)\$($fileName).cs"
575+
WorkingDirectory = $TempPath
576+
Wait = $true
577+
WindowStyle = "Hidden"
578+
}
579+
if ($PSEdition -like "Core") { $paramExecute.Add("WhatIf", $false) }
580+
Start-Process @paramExecute
573581

574582
Write-PSFMessage -Level Debug -Message "Validating generated '$($fileName).dll' file"
575583
foreach ($FinalFile in $finalFilesExpected) {

0 commit comments

Comments
 (0)