Created
August 27, 2016 12:36
-
-
Save babakc/450f48a821f648b30dd3a727d1fb0e16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$EC2SettingsFile="C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml" | |
$xml = [xml](get-content $EC2SettingsFile) | |
$xmlElement = $xml.get_DocumentElement() | |
$xmlElementToModify = $xmlElement.Plugins | |
foreach ($element in $xmlElementToModify.Plugin) | |
{ | |
if ($element.name -eq "AWS.EC2.Windows.CloudWatch.PlugIn") | |
{ | |
$element.State="Enabled" | |
} | |
} | |
$xml.Save($EC2SettingsFile) | |
stop-process -name EC2Config -force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment