Advertisement
RJSN

Set-AzureRMTags

Jul 12th, 2017
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2.         .NOTES
  3.         #---------------------------------------------------------------------------------------
  4.         # Date          : 12-07-2017
  5.         # Script name       : Set-AzureRMTags.ps1
  6.         # Description       : Set tags on Azure RM resources
  7.         # Created by        : Ralph Jansen
  8.         # Extra module      :
  9.         # Copyright         : ©2017 Ralph Jansen, all rights reserved.
  10.         # History           : RJA 12-07-2017 Initial version
  11.         #
  12.         #---------------------------------------------------------------------------------------
  13.        
  14.         .DESCRIPTION
  15.         Set tags on Azure RM resources
  16.        
  17. #>
  18.  
  19. Start-Transcript -Path '$env:tmp\Set-AzureRMTags.log'  -Force
  20.  
  21. Write-Verbose -Verbose "Script started..."
  22.  
  23. Import-Module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1"
  24.  
  25. Login-AzureRmAccount -SubscriptionName "<replace with subscription name>"
  26.  
  27. Find-AzureRmResource | Set-AzureRmResource -Tag @{ DEPARTMENT="Marketing"; ENVIRONMENT="DEVELOPMENT" } -Force
  28.  
  29. Stop-Transcript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement