MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
633 stars 281 forks source link

Missing ApplyDriverPackage.log... #323

Open skipsinclair opened 3 years ago

skipsinclair commented 3 years ago

My Invoke-PS package is going through the process, apparently installing all of the drivers, THEN crashing out with error code 1. However, there's no ApplyDriverPackage.log file being created on the client. I'm running in -DriverUpdate mode with an existing OS, so WinPE/boot image issues don't apply. The only way I can get an ApplyDriverPackage.log file to be created is to run the script in -DebugMode with -username and -password being passed (SCCM read-only service account), and THEN the file says that everything is fine, 1 package verified, good to go!!

But the TS keeps failing. How do I go about troubleshooting this any further without "logging extensively what went wrong" ??

ReeceLovell commented 2 years ago

Did you ever figure this out?

suprnova74 commented 1 year ago

Are you running it from a TS? If you're simply running it as a package, it will most likely fail since the log directory is populated as:

Process {
    # Set Log Path
    switch ($PSCmdLet.ParameterSetName) {
        "Debug" {
            $LogsDirectory = Join-Path -Path $env:SystemRoot -ChildPath "Temp"
        }
        default {
            **$LogsDirectory = $Script:TSEnvironment.Value("_SMSTSLogPath")**
        }
    }

What you can do is try adding a hard-coded $logsDirectory folder or just replace both with the debug value, but I'm leaning towards it's either not running as a TS or it somehow is not able to read the TS environment

nameisstolen commented 1 year ago

My program is working and providing drivers, but the few I have errors on are older devices and they do NOT show in any log yet task sequence status says all is well. 99% of the time it would be used under a task sequence. So I have nothing to work from.