Hp image assistant powershell double backslash problem

Hi,

I need to push some arguments to hpia in order to scan a network drive (i am using powershell deployment toolkit if that matters at all


Start-Process -FilePath 'c:\tools\HPIA\HPImageAssistant.exe' -ArgumentList '/Operation:Analyze /Category:Bios /Action:List /Selection:All /Silent /ReportFolder:"C:\tools\HPIA\Logs" /Offlinemode:"\\192.168.100.30\HPIARepo\23H2\Prod\HP ProBook 445 14 inch G9 Notebook PC"'

i tried also other options but the result is allways the same, it is not working and when i look at the problem the result the tool gives me is allways the same

Image: \\\\192.168.100.30\\HPIARepo\\23H2\\Prod\\HP'"

Hey there and welcome! I may not have the answer but I’ll respond with some info. Please note i’ve never used that tool and from the info you provided this makes me feel like its more of how you’re using the tool and not so much PS related, but I dunno.

First: HP Developers Portal | Driver injection with HP Image Assistant and HP CMSL in MEM CM (upd. 4/27/2021) The example on that page that seems to suggest it supports network paths, but they aren’t using PS to run it, they are just calling it directly. What happens if you try to do something similar? the code from their example:

HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Offlinemode:"\\CM01\share\softpaqs\Repository" /SoftpaqDownloadFolder:C:\HPIA /ReportFolder:C:\HPIA\Logs /Noninteractive /Debug

Additionally: What’s the actual error message you get when it fails? I do see the 4 slashes in the path that you mention in your title but I’m not seeing an actual error message. just because it outputs that isn’t enough IMO to suggest that’s why its failing.

FWIW: I usually see 4 slashes in situations where the slash is actually an escape character. for example, it’s really often to see this with JSON config files, where a slash is escaping another slash so it looks like 4 leading slashes, like this:

$json = '{
  "Path": "\\\\pathhere\\path\\path"
}'
$json | ConvertFrom-Json

<# OUTPUTS
Path
----
\\pathhere\path\path

#>

Additionally: Windows typically ignores extra slashes in paths, except for the leading double slash in a network path. for example

Get-Childitem "C:\Temp"
Get-Childitem "C:\\Temp"
Get-Childitem "C:\\\\\\Temp"

all work happily and produce the same output.

I’d be curious if you tried running the command without using PS to invoke it just to see what happens. I have a feeling if everything else is correct, it should work, based on the example provided by HP in the blog link provided.

hi, thanks for your respons

The application creates a log file that contains the following error, it basicly means that it can’t find the data for the reference image which is logic because of the 4 backslashes and the double ones

{
  "HPIA": {
    "HPIAOperation": "Analyze Action List",
    "ExitCode": "4097",
    "LastOperation": "Initialize",
    "LastOperationStatus": "Unknown",
    "LastOperationStatusDesc": "Target Image: '<This Computer>';Reference Image: '\\\\192.168.100.30\\HPIARepo\\23H2\\Prod\\HP ProBook 445 14 inch G9 Notebook PC'"
  }
}

What happens if you change to:

"%5C%5C192.168.100.30%5CHPIARepo%5C23H2%5CProd%5CHP%20ProBook%20445%2014%20inch%20G9%20Notebook%20PC"

hi,

i haven’t tried it but i finally got it working and had also made a mistake during testing

I did not include test-path yet to test the network share but it seems i had remove the first two \ so the mapping was never created.

then i adjust the parameters to and it works now

-Parameters "/Operation:Analyze /Category:Bios /Action:List /Selection:All /Silent /ReportFolder:C:\tools\HPIA\Logs /SoftpaqDownloadFolder:C:\tools\HPIA\Drivers /Offlinemode:""\\192.168.100.30\HPIARepo\23H2\Prod\HP ProBook 445 14 inch G9 Notebook PC"

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.