Skip to content

Commit e80be6d

Browse files
committed
Added Move-PrtgObject
1 parent 2c10fa5 commit e80be6d

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

prtgshell2.dll

0 Bytes
Binary file not shown.

prtgshell2.psd1

-2 Bytes
Binary file not shown.

prtgshell2.psm1

1.37 KB
Binary file not shown.

src/cmdlets/Move-PrtgObject.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
function Move-PrtgObject {
3+
<#
4+
.SYNOPSIS
5+
6+
.DESCRIPTION
7+
8+
.EXAMPLE
9+
10+
#>
11+
12+
Param (
13+
[Parameter(Mandatory=$True,Position=0)]
14+
[int]$ObjectId,
15+
[Parameter(Mandatory=$True,Position=1)]
16+
[int]$TargetGroupId
17+
)
18+
19+
BEGIN {
20+
if (!($PrtgServerObject.Server)) { Throw "Not connected to a server!" }
21+
}
22+
23+
PROCESS {
24+
25+
$Url = $PrtgServerObject.UrlBuilder("moveobjectnow.htm",@{
26+
"id" = $ObjectId
27+
"targetid" = $TargetGroupId
28+
"approve" = 1
29+
})
30+
31+
$Data = $PrtgServerObject.HttpQuery($Url,$false)
32+
33+
return $Data | select HttpStatusCode,Statuscode
34+
}
35+
}

0 commit comments

Comments
 (0)