< Back

Get-HPERedfishDir

Tue Jan 14, 2020 1:56 am

NAME Get-HPERedfishDir



SYNOPSIS

Gets HPE Redfish data and stores into a node array.





SYNTAX

Get-HPERedfishDir [-Odataid] <String> [[-Session] <PSObject>] [-Recurse] [-DisableCertificateAuthentication]

[<CommonParameters>]





DESCRIPTION

Get-HPERedfishDir cmdlet gets the data at location specified by the 'Odataid' parameter and stores it in a node

array. If Recurse parameter is set, the cmdlet will iterate to every odata id stored within the first node and

every node thereafter storing each node into a node array.





PARAMETERS

-Odataid <String>

Specifies the value of Odataid of Redfish data source to be retrieved. This is concatenated with the root URI

(obtained from session parameter) to get the URI to retrieve the Redfish data.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Session <PSObject>

Session PSObject returned by executing Connect-HPERedfish cmdlet. It must have RootURI and X-Auth-Token for

executing this cmdlet.



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Recurse [<SwitchParameter>]

Switch parameter that turns recursion on if true.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-DisableCertificateAuthentication [<SwitchParameter>]

If this switch parameter is present then server certificate authentication is disabled for the execution of

this cmdlet. If not present it will execute according to the global certificate authentication setting. The

default is to authenticate server certificates. See Enable-HPERedfishCertificateAuthentication and

Disable-HPERedfishCertificateAuthentication to set the per PowerShell session default.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

You can pipe the Odataid to Get-HPERedfishDir.





OUTPUTS

System.Object[]

Get-HPERedfishDir returns an array of PSObject objects that contains the data at the location specified by the

Odataid parameter and by odataids in that data if Recurse parameter is set to true.





NOTES





See typical usage examples in the HPERedfishExamples.ps1 file installed with this module.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$NodeArray = Get-HPERedfishDir -Session $s -Odataid $odataid



PS C:\\> $NodeArray





Description : Manager User Sessions

Items : {@{Description=Manager User Session; Name=User Session; Oem=; Type=Session.0.9.5; UserName=admin;

links=}, @{Description=Manager User Session; Name=User Session; Oem=;

Type=Session.0.9.5; UserName=admin; links=}}

MemberType : Session.0

Name : Sessions

Oem : @{Hp=}

Total : 2

Type : Collection.0.9.5

links : @{Member=System.Object[]; self=}



This example shows the basic execution where there is no recursion. Only the data at the specified Odataid is

returned.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$NodeArray = Get-HPERedfishDir -Session $s -Odataid /redfish/v1/sessionservice/sessions/ -Recurse



PS C:\\> $NodeArray





@odata.context : /redfish/v1/$metadata#Sessions

@odata.id : /redfish/v1/SessionService/Sessions/

@odata.type : #SessionCollection.SessionCollection

Description : Manager User Sessions

Members : {@{@odata.id=/redfish/v1/SessionService/Sessions/admin56baa83eb16872af/},

@{@odata.id=/redfish/v1/SessionService/Sessions/admin56baa870dfbe76c8/}}

Members@odata.count : 2

Name : Sessions

Oem : @{Hp=}



@odata.context : /redfish/v1/$metadata#SessionService/Sessions/Members/$entity

@odata.id : /redfish/v1/SessionService/Sessions/admin56baa83eb16872af/

@odata.type : #Session.1.0.0.Session

Description : Manager User Session

Id : admin56baa83eb16872af

Name : User Session

Oem : @{Hp=}

UserName : admin



@odata.context : /redfish/v1/$metadata#SessionService/Sessions/Members/$entity

@odata.id : /redfish/v1/SessionService/Sessions/admin56baa870dfbe76c8/

@odata.type : #Session.1.0.0.Session

Description : Manager User Session

Id : admin56baa870dfbe76c8

Name : User Session

Oem : @{Hp=}

UserName : admin





This example shows a recursive execution of the cmdlet with the specified Recurse parameter. The second and the

third PSObjects shown above are retrieved recursively using the odataid from the 'Members' property in the first

object.











RELATED LINKS

http://www.hpe.com/servers/powershell