Skip to content

Commit fbdaf0b

Browse files
committed
remove-prtgobject updates
1 parent 1f6b965 commit fbdaf0b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

prtgshell2.psm1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,11 @@ function New-PrtgResult {
850850
# a single prtgshell object object
851851
# or an array of prtgshell object objects
852852

853+
854+
# for handling objects
855+
# needs to string together the objids from the objects received
856+
# and then in the END block, execute the actual DO
857+
853858
function Remove-PrtgObject {
854859
<#
855860
.SYNOPSIS
@@ -862,7 +867,7 @@ function Remove-PrtgObject {
862867

863868
Param (
864869
[Parameter(Mandatory=$True,Position=0)]
865-
$ObjectId
870+
[int[]]$ObjectId
866871
#TODO: document this; $ObjectID for this cmdlet can either be a single integer or a comma-separated string of integers to handle multiples
867872
)
868873

@@ -871,6 +876,8 @@ function Remove-PrtgObject {
871876
}
872877

873878
PROCESS {
879+
[string]$ObjectId = $ObjectId -join ","
880+
874881
$Url = $PrtgServerObject.UrlBuilder("deleteobject.htm",@{
875882
"id" = $ObjectId
876883
"approve" = 1

0 commit comments

Comments
 (0)