Output that Powershell script has failed
Hi there,
I've created a PDQ package to update the BIOS password on our computers. It works perfectly, except it will say it's successful even if it's failed due to the current password not matching the one in the script. Is there a way to get it to report failed?
This is the output for success:
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 0
PSComputerName :
And for failure:
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 6
PSComputerName :
But PDQ just says "Return code: 0" and "Successful" for both.
Thanks,
Tim
Comments
You'll have to capture that output in a variable, then do something like this: