-
hi all i new with psfalcon and have dficulties to create an PS script example: #Requires -Version 5.1 Find-FalconHostname -Path .\hostname.txt Add-FalconGroupingTag -id -Tags FalconGroupingTags/tag1, FalconGroupingTags/tag2 Error when using "-id " Line |
8 | Add-FalconGroupingTag -"id" -Tags FalconGroupingTags/tag1, FalconGrou …
| ~~~~~
| Cannot validate argument on parameter 'Id'. The argument "-id" does not match the "^[a-fA-F0-9]{32}$" pattern.
| Supply an argument that matches "^[a-fA-F0-9]{32}$" and try the command again. Error when using -id Line |
8 | Add-FalconGroupingTag -id -Tags FalconGroupingTags/tag1, FalconGroupi …
| ~~~
| Missing an argument for parameter 'Id'. Specify a parameter of type 'System.String[]' and try again. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Unless GitHub is mangling your example, it looks like you are using Try one of these options: $HostList = Find-FalconHostname -Path .\hostname.txt
if ($HostList) { $HostList | Add-FalconGroupingTag -Tags FalconGroupingTags/tag1, FalconGroupingTags/tag2 } Find-FalconHostname -Path .\hostname.txt | Add-FalconGroupingTag -Tags FalconGroupingTags/tag1, FalconGroupingTags/tag2 |
Beta Was this translation helpful? Give feedback.
-
works with second option. tks a lot |
Beta Was this translation helpful? Give feedback.
-
Hello! In case you can help me. How could the script be modified to read from a txt file all the IDs and apply the tag only to those hosts? thanks! |
Beta Was this translation helpful? Give feedback.
Unless GitHub is mangling your example, it looks like you are using
Find-FalconHostname
to find the requireddevice_id
values expected by theId
parameter ofAdd-FalconGroupingTag
, but you're dropping them before you run the command.Try one of these options: