We have a number of Azure NSG entries in a NSG which are dynamically added by another process which are named in the format of "1653993491-2018-10-19"
What we would like to do is have a powershell script that, pulls all inbound rules on the NSG, parses out the date out of the name and checks once a day if the entries are older than X days(60) from current date and removes the respective rule.
Anyone have any suggestion this? Not sure how to go about making a loop to pull it for all lines and check. The parsing aspect I feel should not be too complicated. Anyone has any tips suggestions for the loop would be appreciated
as a starting point.