Hi Team,
I start in PRTG API and I want to use the power shell to add equipment
I tried to test clone equipment but I can't. I manage to connect to the server and retrieve information and even create a new sensor in a device already created.
equipment I want to clone: Name: 192.168.50.149 IP: 192.168.50149 ID:3225 (URL for ID: http://127.0.0.1/device.htm?id=3225&tabid=1)
IP for the new devices: 192.168.50.150
DestinationId 2229 is my groupe (http://127.0.0.1/group.htm?id=2229&tabid=1)
Code powershell: $newDevice = Get-Device -Id 3225 | Clone-Objet -DestinationId 2229 "192.168.50.149.clone" "192.168.50.150"
when I execute the code I get an error message on "Clone-Object" which did not recognize
Can you tell me where my error is?
Thank you
I use this link: https://github.com/lordmilko/PrtgAPI/wiki/Object-Creation#device-creation-1
Article Comments
Hi Flo,
As PrtgAPI is a third party product you should ask questions under the GitHub Issues page rather than ask on the Paessler forums
Are you able to advise what the exact error message you are getting is?
Mar, 2020 - Permalink
Yes i have the error message
This Error is
Clone-Objet : Le terme «Clone-Objet» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez. Au caractère Ligne:1 : 34 + $newDevice =Get-Device -Id 3225 |Clone-Objet -DestinationId 2229 "192 ... + ~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Clone-Objet:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I will post the error on Github;)
Mar, 2020 - Permalink
The command is called Clone-Object. In the above error message it appears you have typed Clone-Objet, without the "c" in the word Object
Mar, 2020 - Permalink
Dear Flo,
the PrtgAPI is a user project by lordmilko, this is why there is no Paessler support for this. Other users might reply here in the knowledge base though.
Mar, 2020 - Permalink