Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication with BCU fails for systems with PowerShell 4.0 #77

Closed
texhex opened this issue Oct 10, 2018 · 2 comments
Closed

Communication with BCU fails for systems with PowerShell 4.0 #77

texhex opened this issue Oct 10, 2018 · 2 comments
Labels

Comments

@texhex
Copy link
Owner

texhex commented Oct 10, 2018

BIOS Sledgehammer fails in the step "Verifying BIOS Configuration Utility (BCU) can communicate with BIOS." with the message:

C:\TEMP\BiosSledgehammer\BiosSledgehammer.ps1 : BCU is unable to communicate with BIOS, can't continue.
        At C:\TEMP\BiosSledgehammer\BiosSledgehammer.ps1:227 char:13

The line in question is 652:

$output = &$BCU_EXE /GetValue:`"$Name`" | Out-String )

This was last changed in commit 7850d42.

It works properly in case the value $PSVersionTable.PSVersion.Major = 5.
In case the value $PSVersionTable.PSVersion.Major = 4, the grave accents have to be removed:

$output = &$BCU_EXE /GetValue:"$Name" | Out-String ).

The actual problem is that in PowerShell 4.0, the grace accents seem not to be working as expected, so PowerShell somehow creates several additional parameters and BCU will only read the BIOS value name until the space.

Verifying BIOS Configuration Utility (BCU) can communicate with BIOS.
  Trying to read Universally Unique Identifier (UUID)...VERBOSE: Reading BIOS setting using different setting names
VERBOSE:    Trying using setting name [Universally Unique Identifier (UUID)]...
VERBOSE: &C:xxxx\BiosConfigUtility64.exe /GetValue:"Universally Unique 
Identifier (UUID)" | Out-String
VERBOSE: Read BIOS value: Result from BCU =============
VERBOSE: <BIOSCONFIG Version="" Computername="yyyyy" Date="2018/10/0y" Time="zz:zz:00" UTC="2">
 <SETTING changeStatus="warning" name = "Universally" returnCode="20">
  <VALUE><![CDATA[]]></VALUE>
 </SETTING>
 <Information msg="BCU return value" real="0" translated="0" />
</BIOSCONFIG>
VERBOSE: ==============================================
VERBOSE: Value: 
VERBOSE: Return code: 20

What seems to do the trick is to double escape the quotation marks like this:

$output = &$BCU_EXE /GetValue:""$Name"" | Out-String

It needs to checked if this also works for 5.0 and if also the Set BIOS Value function needs rework.

@texhex
Copy link
Owner Author

texhex commented Oct 28, 2018

This change has been done for BCU Get/Set calls, and in my first test calls it works as expected. I need to get a PS 4.0 machine to fully test it; this might take some days.

@texhex
Copy link
Owner Author

texhex commented Dec 19, 2018

I got confirmation from a colleague yesterday that all his tests were successful, the BCU calls now work correctly with PS 4.0 and no errors were reported for 5.1. Closing issue.

@texhex texhex closed this as completed Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant