When using xPackage to install with an exe, with a LogPath specified, after the installation is complete the resource can fail with the error "Event with source identifier 'LogPath' does not exist.". I believe this happens when the exe does not actually output anything.
Verbose logs
VERBOSE: [server-name]: LCM: [ Start Resource ] [[xPackage]InstallVSRemoteDebugger]
VERBOSE: [server-name]: LCM: [ Start Test ] [[xPackage]InstallVSRemoteDebugger]
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] The path extension was '.exe'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\cimv2,'className' = Win32_OperatingSystem'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Operation 'Enumerate CimInstances' complete.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Ensure is 'Present'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Product installation cannot be determined
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] product as boolean is 'False'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] The package 'VSRemoteDebugger' is not installed.
VERBOSE: [server-name]: LCM: [ End Test ] [[xPackage]InstallVSRemoteDebugger] in 0.2030 seconds.
VERBOSE: [server-name]: LCM: [ Start Set ] [[xPackage]InstallVSRemoteDebugger]
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] The path extension was '.exe'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\cimv2,'className' = Win32_OperatingSystem'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Operation 'Enumerate CimInstances' complete.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Ensure is 'Present'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Product installation cannot be determined
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] product as boolean is 'False'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] The package 'VSRemoteDebugger' is not installed.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] The path extension was '.exe'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Package configuration starting.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Create log file.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Download the media over HTTP or HTTPS.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Creating cache location.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Need to download file from 'https', destination will be
'C:\ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache\DSC_xPackageResource\VSRemoteDebugger-17.0.34606.255.exe'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Creating the destination cache file.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Creating the 'https' stream.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Setting default credential.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Getting the 'https' response stream.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Copying the 'https' stream bytes to the disk cache.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Redirecting package path to cache file location.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] The binary is an EXE.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] User has requested logging, need to attach event handlers to the process.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Starting 'C:\ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache\DSC_xPackageResource\VSRemoteDebugger-17.0.34606.255.exe' with
'/quiet /norestart /log "C:\Logs\DSC\InstallVSRemoteDebugger.log" /quiet /norestart'.
VERBOSE: [server-name]: [[xPackage]InstallVSRemoteDebugger] Starting process
'C:\ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache\DSC_xPackageResource\VSRemoteDebugger-17.0.34606.255.exe' with arguments '/quiet /norestart /log "C:\Logs\DSC\InstallVSRemoteDebugger.log" /quiet /norestart'.
VERBOSE: [server-name]: LCM: [ End Set ] [[xPackage]InstallVSRemoteDebugger] in 69.3450 seconds.
PowerShell DSC resource DSC_xPackageResource failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to
Stop: Event with source identifier 'C:\Logs\DSC\InstallVSRemoteDebugger.out.log' does not exist.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
Name Version Path
---- ------- ----
xPSDesiredStateConfiguration 9.1.0 C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\9.1.0\xPSDesiredStateConfiguration.psd1
Problem description
When using xPackage to install with an exe, with a LogPath specified, after the installation is complete the resource can fail with the error "Event with source identifier '
LogPath
' does not exist.". I believe this happens when the exe does not actually output anything.Verbose logs
DSC configuration
Suggested solution
Replace the
Get-Event
calls here with something like:Operating system the target node is running
PowerShell version and build the target node is running
xPSDesiredStateConfiguration version