$status_message = get-HPiLoFirmwareversion -Server 172.16.2.210 -Username administrator -Password xxxx -DisableCertificateAuthentication -WarningAction SilentlyContinue | Select-Object -Property STATUS_MESSAGE
if ($status_message -eq '@{STATUS_MESSAGE=OK}'){
Write-Host "Status OK"
Exit 0
}
else {
Write-Host "error"
Exit 0
}
Write-Host $status_message
but im getting output:
@{STATUS_MESSAGE=OK}
instead of just OK
get-HPiLoFirmwareversion -Server 172.16.2.210 -Username administrator -Password xxxxx -DisableCertificateAuthentication -WarningAction SilentlyContinue
Write-Host $status_message
IP : 172.16.2.210
HOSTNAME :
STATUS_TYPE : OK
STATUS_MESSAGE : OK
FIRMWARE_DATE : Sep 23 2016
FIRMWARE_VERSION : 2.50
LICENSE_TYPE : iLO Advanced
MANAGEMENT_PROCESSOR : iLO4
@{STATUS_MESSAGE=OK}
Aucun commentaire:
Enregistrer un commentaire