Hp.firmware.psm1 and get-efipartitionpath error

9 posts / 0 new
Last post
Author
Message
jasonrothstein
Posted: 25 December 2021 - 9:14am
Hp.firmware.psm1 and get-efipartitionpath error

I've got a fleet of 845 G7 laptops I'm trying to upgrade the BIOS on, and can't for the life of me figure out why this process is failing on this step.  All devices are original factory image and have UEFI/Secure Boot enabled.

hp.firmware.ps1 bombs here:

PS C:\Program Files\WindowsPowerShell\Modules\HP.Firmware\1.6.4> Get-EFIPartitionPath
Could not locate EFI partition. 
At C:\Program Files\WindowsPowerShell\Modules\HP.Firmware\1.6.4\HP.Firmware.psm1:1239 char:5
+     throw [System.Management.Automation.ItemNotFoundException]"Could  ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : SessionStateException

But if I run the commands manually, it should see the EFI status I would think:

PS C:\Program Files\WindowsPowerShell\Modules\HP.Firmware\1.6.4> get-partition

   DiskPath: 
\\?\scsi#disk&ven_nvme&prod_mtfdhba256tdv-1a#5&280f8c11&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

PartitionNumber  DriveLetter Offset                                   Size Type                              
---------------  ----------- ------                                   ---- ----                              
1                            1048576                                260 MB System                            
2                            273678336                               16 MB Reserved                          
3                C           290455552                           237.51 GB Basic                             
4                            255319867392                           701 MB Recovery      

S C:\Program Files\WindowsPowerShell\Modules\HP.Firmware\1.6.4> get-volume | Select-Object

DriveLetter FriendlyName     FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining      Size
----------- ------------     -------------- --------- ------------ ----------------- -------------      ----
            Windows RE Tools NTFS           Fixed     Healthy      OK                    110.93 MB    701 MB
C           Windows          NTFS           Fixed     Healthy      OK                     74.99 GB 237.51 GB
            SYSTEM           FAT32          Fixed     Healthy      OK                    166.73 MB    256 MB

PS C:\Program Files\WindowsPowerShell\Modules\HP.Firmware\1.6.4> Get-HPDeviceBootInformation

Name                           Value                                                                         
----                           -----                                                                         
BootTime                       12/24/2021 9:32:35 AM                                                         
SecureBoot                     True                                                                          
Uptime                         1 days, 1 hours, 40 minutes, 18 seconds                                       
Mode                           UEFI     

 

 

Top
Author
Message
jasonrothstein
Posted: 16 January 2022 - 7:36am
Re: Hp.firmware.psm1 and get-efipartitionpath error

So who and/or what number can I call to open a support case for this?  I've got over a hundred HP laptops I can't update because of this issue.  Can't use CMSL to update the BIOS, and can't use the new Command for MEM to do it, as it uses the same powershell scripts with the same get-efipartitionpath dependency.  I've tracked the issue down to this WMI query that gets called by the Get-EFIPartitionpath function:

---------------

select * from WSP_PartitionToVolume where Volume="WSP_Volume.ObjectId=\"{b43dc964-5963-11eb-b801-806e6f6e6963}:VO:\\\\\\\\?\\\\Volume{66ee4aa1-d661-4d27-bd80-aa58d132df07}\\\\\""

ACCESS DENIED

------------------------

However, this works just fine:

-------------------------

select * from WSP_PartitionToVolume

\\.\ROOT\Microsoft\Windows\Storage\Providers_v2:WSP_Partition.ObjectId="{b43dc964-5963-11eb-b801-806e6f6e6963}:PR:{00000000-0000-0000-0000-100000000000}\\\\?\\scsi#disk&ven_nvme&prod_mtfdhba256tdv-1a#5&280f8c

\\.\ROOT\Microsoft\Windows\Storage\Providers_v2:WSP_Partition.ObjectId="{b43dc964-5963-11eb-b801-806e6f6e6963}:PR:{00000000-0000-0000-0000-501100000000}\\\\?\\scsi#disk&ven_nvme&prod_mtfdhba256tdv-1a#5&280f8c11&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}"

\\.\ROOT\Microsoft\Windows\Storage\Providers_v2:WSP_Volume.ObjectId="{b43dc964-5963-11eb-b801-806e6f6e6963}:VO:\\\\?\\Volume{5d36e608-6bbb-4292-b359-9809c2e91d8c}\\"

---------------------------

I can't for the life of me figure out what is throwing the "access denied" on the full query.  Command are being run elevated.  I've wiped machines and tried.  I've rebuilt WMI...  Does this function work for anyone, and if so what does your output look like?

Top
Author
Message
txvalp
Posted: 16 January 2022 - 1:15pm
Re: Hp.firmware.psm1 and get-efipartitionpath error

Jason,

That functionality uses the following calls:

  • get-disk
  • get-volume
  • get-partition

Do all these work ok?

Another thing to try, if you have any security solution, can you please try disabling (or uninstalling them, as a test)? I've seen for example bitdefender's heuristic (AKA "Advanced Thread Defense") blocking powershell scripts randomly, which do result in an "Access Denied" (because they are blocking the actual scripts from running). Or at least, check the logs/quarantine in your security suite  for any powershell-related events. 

Is this on an unmodified shipping image? If it is, I can see if we can locate it and try it out.  We'd need to know the configuration and OS version (1908, 20H2, etc) for best results.

 

 

 

Top
Author
Message
jasonrothstein
Posted: 19 January 2022 - 7:12pm
Re: Hp.firmware.psm1 and get-efipartitionpath error

They sure do, see below.  It's not powershell that is failing, it's the wmi queries that are made from the powershell commands, but only the one I listed above.  We use Defender, but there are no blocks or quarantine actions taking place, and the same get-efipartitionpath ironically works on our domain joined Lenovo's and Dells that have the same software installed.

All machines are 845 G7 Elitebooks, factory image with the exception of Sure Admin, Sure Sense, Sure Click, and Wolf Security uninstalled.  OS's range from 2004 to 21h2

 

S C:\WINDOWS\system32> get-disk

Number Friendly Name Serial Number                    HealthStatus         OperationalStatus      Total Size Partition                                                                                                              Style ------ ------------- -------------                    ------------         -----------------      ---------- ---------- 0      MTFDHBA256... 0000_0000_0000_0001_00A0_7520... Healthy              Online                  238.47 GB GPT

PS C:\WINDOWS\system32> get-volume

DriveLetter FriendlyName      FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining      Size ----------- ------------      -------------- --------- ------------ ----------------- -------------      ----             Windows RE Tools  NTFS           Fixed     Healthy      OK                    110.93 MB    701 MB C           Windows           NTFS           Fixed     Healthy      OK                     55.96 GB 237.51 GB             PortableBaseLayer NTFS           Fixed     Healthy      OK                      7.51 GB      8 GB             SYSTEM            FAT32          Fixed     Healthy      OK                     166.5 MB    256 MB

PS C:\WINDOWS\system32> get-partition

   DiskPath: \\?\scsi#disk&ven_nvme&prod_mtfdhba256tdv-1a#5&280f8c11&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

PartitionNumber  DriveLetter Offset                                        Size Type ---------------  ----------- ------                                        ---- ---- 1                           1048576                                     260 MB System 2                           273678336                                    16 MB Reserved 3                C           290455552                                237.51 GB Basic 4                           255319867392                                701 MB Recovery

Top
Author
Message
txvalp
Posted: 20 January 2022 - 1:04pm
Re: Hp.firmware.psm1 and get-efipartitionpath error

Thank you. We'll check to see if we can reproducre the issue.

 

Top
Author
Message
txvalp
Posted: 25 January 2022 - 6:44pm
Re: Hp.firmware.psm1 and get-efipartitionpath error

We pulled this model and ran a test, and we were not able to reproduce the issue, everything worked fine. Could you think of something else that may be causing it? How are you running the operation? What powershell version? 64-bit PS, i hope?

Our test unit was this:

845 G7 Fresh image BIOS S77 01.08.00 01/12/2022 Microsoft Windows 10 Pro Education - Build 19042

 

Top
Author
Message
jasonrothstein
Posted: 30 January 2022 - 6:07pm
Re: Hp.firmware.psm1 and get-efipartitionpath error

We're going to try factory restoring one and see if it works, because we can't explain it.  We figured that if it works on a Lenovo with the same suite of corporate security sofwtare on it, then it couldn't be that, but we'll see.

It's nothing to do with powershell version or bitness, the powershell goes through.  What we found is that the individual get-partition and get-volume commands in the powershell function work fine, and the path for the EFI partition is queried correctly, it's only when the function pumps the results into an array, the path for the efi partition is instead null.  Looking deeper, we found that powershell functions like get-volume and get-partition have underlying wmi queries, so turned on WMI tracing, and that's where we see the issue.  The complete WMI query fails, despite its parts working. 

Top
Author
Message
alex.scandler
Posted: 4 February 2022 - 11:49am
Re: Hp.firmware.psm1 and get-efipartitionpath error

Hii , try to check on google .

Top
Author
Message
shugibugi84
Posted: 5 February 2022 - 10:23pm
Re: Hp.firmware.psm1 and get-efipartitionpath error

Hii , thank you in advance  , i found the solution on google . 

Top
Please login to comment