Remote Lights-Out Mgmt (iLO 2, iLO, RILOE II) Forum
Showing results for 
Search instead for 
Do you mean 

HPE Scripting Tools for Windows PowerShell - Bug or me?

SOLVED
Go to Solution
Occasional Contributor

HPE Scripting Tools for Windows PowerShell - Bug or me?

Hi,

Is anyone else experiencing dificulties with the Feb 2016 release of iLO cmdlets (v. 1.3.0.0)?

I installed, logged on as an admin, which atleast populates $env:PSModulesPath correctly (runas admin doesn't).

When I run the cmdlet "Find-HPiLO 192.168.5.38", I get:

Find-HPiLO 192.168.5.38
WARNING: It might take a while to search for all the HP iLOs if the input is a very large range. Use Verbose for more information.
New-Object : Cannot find type [AsyncPipeline]: verify that the assembly containing this type is loaded.
At C:\Program Files\Hewlett-Packard\PowerShell\Modules\HPiLOCmdlets\HPiLOCmdlets.psm1:1687 char:12
+     $Output = New-Object AsyncPipeline
+               ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
 
The property 'Pipeline' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files\Hewlett-Packard\PowerShell\Modules\HPiLOCmdlets\HPiLOCmdlets.psm1:1689 char:2
+     $Output.Pipeline = $Pipeline
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound
 
The property 'AsyncResult' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files\Hewlett-Packard\PowerShell\Modules\HPiLOCmdlets\HPiLOCmdlets.psm1:1690 char:2
+     $Output.AsyncResult = $AsyncResult
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound
 
Get-ThreadPipelines : Unable to find type [AsyncPipeline]. Make sure that the assembly that contains this type is loaded.
At C:\Program Files\Hewlett-Packard\PowerShell\Modules\HPiLOCmdlets\HPiLOCmdlets.psm1:9823 char:15
+             $iLOList = Get-ThreadPipelines -Pipelines $ThreadPipes
+                        ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (AsyncPipeline:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

It appears the problem is in HPiLOCmdlets.psm1, line 27 - 33:

Add-Type @'
public class AsyncPipeline
{
    public System.Management.Automation.PowerShell Pipeline ;
    public System.IAsyncResult AsyncResult ;
}
'@

I'm affraid the .NET stuff is beyond me.

Any pointers or help would be apreciated...


Thanks, W.

3 REPLIES
Occasional Contributor

Re: HPE Scripting Tools for Windows PowerShell - Bug or me?

[ Edited ]

UAC - grrrrr,

Although my Powershell session is running as my Domain Admin account and my Domain Admin account is added to local administrators, it doesn't "elevate" to local Admin.

I HATE UAC!!!

The toublesome bit of code in the HP module:

Add-Type @'
public class AsyncPipeline
{
    public System.Management.Automation.PowerShell Pipeline ;
    public System.IAsyncResult AsyncResult ;
}
'@

Running it on its own results in:

Add-Type : Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /noconfig 
/fullpaths @"C:\Users\aDomainAdminUser\AppData\Local\Temp\dyf2ldne.cmdline".
At line:1 char:1
+ Add-Type @'
+ ~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Type], ExternalException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.ExternalException,Microsoft.PowerShell.Commands.AddTypeCommand

The file: 

C:\Users\aDomainAdminUser\AppData\Local\Temp\dyf2ldne.cmdline

is never created - because UAC prevents it.

Hope that helps anyone else in a similar boat.

T, W. 

Re: HPE Scripting Tools for Windows PowerShell - Bug or me?


Thanks for the post.  Our HPE PowerShell development team is looking at this to see if there is a better way to work around the issue and whether a fix can be added to improve this.

Thanks,

HPE PowerShell Team

jlg

Visitor

Re: HPE Scripting Tools for Windows PowerShell - Bug or me?

We could reproduce the issue after following below steps to remove write permission on "Temp" folder of logged in windows user.  It looks like logged in user does not have sufficient permissions on "TEMP" folder which is making the Find cmdlet to behavior like this.

Some temp files like *.cmdline get created by PowerShell engine when it executes our Find-HPiLO cmdlet and due to insufficient permission cmdlet is unable to create those temp files under TEMP folder which is causing for this behavior.

Below are the steps to reproduce the issue :

Remove the write permissions from the Temp folder of the user profile for example -C:\Users\user_name\AppData\Local\Temp. The AppData is usually a hidden folder.

  • Right click on the Temp folder of the user profile, Go to properties-> Security
  • Select the admin account and click on Edit.
  • A popup “Permission for Temp” appears.
  • Select the admin account/ account with which the user is logged in.
  • Select check option in the deny list of the “Permissions for the Users” box.
  • Click apply.

 

Hope this answers your question.

Thanks,

Gokul

HPE PowerShell Team