Giter VIP home page Giter VIP logo

reconciletagnames's Introduction

Reconcile Tag Names

Used to alter tags across an environment to correct incorrect tag names/spelling/case differences.

e.g. Cost Centre / Cost Center / CostCenter / Costcenter

Usage

PS C:\>ReconcileTagNames.ps1 -Subscription "cf0f9db2-7009-41d4-a360-f7e5ed552c13" `
        -TagFixes @{"Cost Center"="CostCentre";"Cost Centre"="CostCentre","CostCentre"="CostCentre"} `
        -TagCorrections "CostCentre"

Scans the subscription for tags which match the keys of the TagFixes hashtable. For each incorrect tag it will display the operations to be performed e.g. add/remove and the id of the resource and the tag value. Does not actually perform any changes.

PS C:\>ReconcileTagNames.ps1 -Subscription "cf0f9db2-7009-41d4-a360-f7e5ed552c13" `
        -TagFixes @{"Cost Center"="CostCentre";"Cost Centre"="CostCentre","CostCentre"="CostCentre"} `
        -TagCorrections "CostCentre" `
        -UpdateTags

As above but will update the tag names and values across the subscription scope.

PS C:\>ReconcileTagNames.ps1 -Subscription "cf0f9db2-7009-41d4-a360-f7e5ed552c13" `
        -TagFixes @{"Cost Center"="CostCentre";"Cost Centre"="CostCentre","CostCentre"="CostCentre";"appname"="Application";"Application"="Application"} `
        -TagCorrections "CostCentre","Application" `
        -UpdateTags

As above but will also fix the Application tag casing and change and tag with a name of appname to Application. Note the corrected tag must appear in the TagCorrections parameter.

PS C:\>ReconcileTagNames.ps1 -ManagementGroupId "my-root-management-group" `
        -TagFixes @{"Cost Center"="CostCentre";"Cost Centre"="CostCentre","CostCentre"="CostCentre";"appname"="Application";"Application"="Application"} `
        -TagCorrections "CostCentre","Application" `
        -UpdateTags

Same as above but the target will be the management group defined in the parameter.

reconciletagnames's People

Contributors

anwather avatar

Stargazers

Kair00 avatar Jamie Phillips avatar Nilson Gonçalves avatar Jeff Chase avatar Jason Omar avatar

Watchers

 avatar

Forkers

arthursilvany

reconciletagnames's Issues

Is this part of code necessary?

I was wondering if this part of the code is necessary. It doesn't seem to ever evaluate. Which is a good thing as why would we want to delete a correct tag?

elseif (!($tag.Name -in $tagCorrections)) {
     Write-Output "Correct Tag already exists"
     $obj = [PsCustomObject]@{
           id      = $id.ResourceId
           action  = "Remove"
           tagName = $tag.Name
     }
     $actions += $obj
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.