Skip to content

Commit

Permalink
Fixed error message (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
marranaga authored Oct 1, 2019
1 parent 266895f commit ab0b283
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
OK:
0
[
{
"name": "Computer1",
"id": "LeafNodeId1",
"message": "Computer deleted successfully",
"status": "0"
}
]
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
OK:
0
[
{
"name": "Computer2",
"id": "LeafNodeId2",
"message": "Computer deleted successfully",
"status": "0"
}
]
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
OK:
1
[
{
"name": "Computer3",
"id": "LeafNodeId3",
"message": "java.lang.NullPointerException",
"status": "1"
}
]
8 changes: 4 additions & 4 deletions ePOwerShell/Public/Remove-ePOComputer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ function Remove-ePOComputer {
if ($PSCmdlet.ShouldProcess("Remove ePO computer: $($C.ComputerName)")) {
$Result = Invoke-ePORequest @Request

if ($Result -eq 0) {
if ($Result.Status -eq 0) {
Write-Verbose ('Deleted computer: {0}' -f $C.ComputerName)
} else {
Throw ('Unknown response while deleting computer {0} from ePO: {1}' -f $C.ComputerName, $Result)
Throw ('Unknown response while deleting computer {0} from ePO: {1}' -f $C.ComputerName, ($Result | Out-String))
}
}
}
Expand All @@ -105,10 +105,10 @@ function Remove-ePOComputer {
if ($PSCmdlet.ShouldProcess("Remove ePO computer: $($C.ComputerName)")) {
$Result = Invoke-ePORequest @Request

if ($Result -eq 0) {
if ($Result.Status -eq 0) {
Write-Verbose ('Deleted computer: {0}' -f $C.ComputerName)
} else {
Throw ('Unknown response while deleting computer {0} from ePO: {1}' -f $C.ComputerName, $Result)
Throw ('Unknown response while deleting computer {0} from ePO: {1}' -f $C.ComputerName, ($Result | Out-String))
}
}
}
Expand Down

0 comments on commit ab0b283

Please sign in to comment.