Get-WinEvent instead of Get-EventLog
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- powershell
- Lĩnh vực
- devops, operating-systems
Hướng nghiên cứu
Kiểm tra Get-WindowsEventLogRestrictGuestAccess và Set-WindowsEventLogRetentionDays quanh các dòng 717 và 971, bắt đầu với các lệnh gọi Get-EventLog đã được báo cáo. Thay thế các lệnh gọi đó bằng truy vấn Get-WinEvent được đề xuất, sau đó xác minh rằng tài nguyên WindowsEventLog hoạt động với PowerShell 7 trên Windows Server 2019.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem description
Get-EventLog is deprecated in favor of Get-WinEvent and when trying to use WindowsEventLog from ComputerManagemntDsc with GuestConfig Agent I am getting an error message like the following
Verbose logs
The term 'Get-EventLog' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. The PowerShell DSC resource '[WindowsEventLog]LOG_NAME' with SourceInfo 'E:\agent\_work\1212\dev\build\configurations\dev\WindowsEventLog_LOG_NAME.ps1::6::9::WindowsEventLog' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details. The SendConfigurationApply function did not succeed. LCM failed to start desired state configuration manually.
DSC configuration
Configuration WindowsEventLog_LOG_NAME
{
Import-DSCResource -Name WindowsEventLog -ModuleName ComputerManagementDsc -ModuleVersion 10.0.0
Node localhost
{
WindowsEventLog LOG_NAME
{
LogName = 'LOG_NAME'
RegisteredSource = 'LOG_NAME'
IsEnabled = $true
}
}
}
WindowsEventLog_LOG_NAME -OutputPath .\mof-files\WindowsEventLog_LOG_NAME\
Suggested solution
Remove Get-EventLog from the following functions Get-WindowsEventLogRestrictGuestAccess and Set-WindowsEventLogRetentionDays
Replace 717 and 971 with the following code
$matchingEventLog = Get-WinEvent -ListLog $Logname -ErrorAction Stop
Operating system the target node is running
OsName : Microsoft Windows Server 2019 Standard
PowerShell version and build the target node is running
PowerShell ver 7 is what our build and deploy pipeline are running
ComputerManagementDsc version
Version 10
- Ngôn ngữ chính
- PowerShell
- Star
- 338
- Fork
- 80
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dsccommunity/ComputerManagementDsc
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
chore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
chore: Add Agentic AI development assets for GitHub CopilotCó thể đã có người làm @PlagueHO đã nhận 120 ngày trước. Đang mởchore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
-
Computer: AD object deletion before domain join issueCó thể đã có người làm @Daymarvi đã nhận 123 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của dsccommunity/ComputerManagementDsc
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
taskcluster/taskcluster#9284 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ROCm/rocm-systems#13754 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
splunk/terraform-provider-splunk#256 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: SHA pin 3rd party actionsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 3 ngày