< Back

Get-HPERedfishDataRaw

Tue Jan 14, 2020 1:56 am

NAME Get-HPERedfishDataRaw



SYNOPSIS

Retrieves data for provided Odataid.





SYNTAX

Get-HPERedfishDataRaw [-Odataid] <String> [[-Session] <PSObject>] [-DisableCertificateAuthentication]

[[-OutputType] <String>] [[-Path] <String>] [-Force] [<CommonParameters>]





DESCRIPTION

Retrieves the HPE Redfish data returned from the source pointed to by the Odataid in PSObject format.

This cmdlet uses the session information to connect to the Redfish data source and retrieves the data to the user

in PSObject format. Session object with ???????RootUri????????, ???????X-Auth-Token???????? and ???????Location???????? information of the session must

be provided for using sessions to retrieve data.





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 where the WebRequest has to be sent.



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



-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



-OutputType <String>

Specifies the format of required output. Possible values are PSObject, String and ByteArray. Default value is

PSObject. If you need to download a binary file from the interface, then use 'ByteArray' as OutputType. The

returned value can be stored into a file when the Path parameter is used.



Required? false

Position? 3

Default value PSObject

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Path <String>

Specifies the location of the file where the output of Get-HPERedfishDataRaw has to be saved.



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces this cmdlet to create an item that writes over an existing read-only item. This parameter will create

the file even if the directories in the mentioned Path do not exist. The directories will be created by

PowerShell when the Force parameter is used.



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 parameter to Get-HPERedfishDataRaw.





OUTPUTS

System.Management.Automation.PSCustomObject

Get-HPERedfishDataRaw returns a PSCustomObject that has the retrieved data.





NOTES





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



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



PS C:\\>$sys = Get-HPERedfishDataRaw -Odataid /redfish/v1/systems/1/ -Session $s



PS C:\\> $sys





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

@odata.id : /redfish/v1/Systems/1/

@odata.type : #ComputerSystem.1.1.0.ComputerSystem

Actions : @{#ComputerSystem.Reset=}

AssetTag : Test111

BiosVersion : P89 v2.00 (06/07/2015)

Boot : @{BootSourceOverrideEnabled=Disabled; BootSourceOverrideTarget=None;

UefiTargetBootSourceOverride=None}

Description : Computer System View

HostName :

Id : 1

IndicatorLED : Off

Links : @{Chassis=System.Object[]; ManagedBy=System.Object[]}

LogServices : @{@odata.id=/redfish/v1/Systems/1/LogServices/}

Manufacturer : HPE

MemorySummary : @{Status=; TotalSystemMemoryGiB=8}

Model : ProLiant DL380 Gen9

Name : Computer System

Oem : @{Hp=}

PowerState : On

ProcessorSummary : @{Count=2; Model=Intel(R) Xeon(R) CPU E5-2683 v3 @ 2.00GHz; Status=}

Processors : @{@odata.id=/redfish/v1/Systems/1/Processors/}

SKU : 501101-001

SerialNumber : LASDFGHRJ5Y00Z

Status : @{Health=Warning; State=Enabled}

SystemType : Physical

UUID : 31313035-3130-434C-4841-533031524A35



This example retrieves system data.









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



PS C:\\>$sessions = Get-HPERedfishDataRaw -Odataid '/redfish/v1/sessionservice/Sessions/' -Session $session



$mysession = Get-HPERedfishDataRaw -Odataid $sessions.Oem.Hp.Links.MySession.'@odata.id' -Session $session

if($mysession.Oem.Hp.MySession -eq $true)

{

$mysession

$mysession.oem.hp

}





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

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

@odata.type : #Session.1.0.0.Session

Description : Manager User Session

Id : admin56ba7c4648f5c28f

Name : User Session

Oem : @{Hp=}

UserName : admin



@odata.type : #HpiLOSession.1.0.0.HpiLOSession

AccessTime : 2016-02-10T00:07:16Z

LoginTime : 2016-02-09T23:54:46Z

MySession : True

Privileges : @{LoginPriv=True; RemoteConsolePriv=True; UserConfigPriv=True; VirtualMediaPriv=True;

VirtualPowerAndResetPriv=True; iLOConfigPriv=True}

UserAccount : admin

UserDistinguishedName :

UserExpires : 2016-02-10T00:12:16Z

UserIP : 16.100.237.28

UserTag : Web UI

UserType : Local



This example shows the process to retrieve current user session.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$biosData = Get-HPERedfishDataRaw -Odataid '/redfish/v1/registries/' -Session $session



foreach($reg in $registries.items)

{

if($reg.Schema -eq $biosAttReg)

{

$attRegLoc = $reg.Location|Where-Object{$_.Language -eq 'en'}|%{$_.uri.extref}

break

}

}

$attReg = Get-HPERedfishDataRaw -Odataid $attRegLoc -Session $session

$attReg.RegistryEntries.Dependencies





The example shows retrieval of Dependencies of BIOS settings. The BIOS attribute registry value is present in

$biosAttReg. The English version of the registry is retrieved.











RELATED LINKS

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