File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ $compat_path = '"C:\Program Files\Google\Compute Engine\agent\GCEWindowsCompatMa
2727$compat_display_name = ' Google Compute Engine Compat Manager'
2828$compat_description = ' Google Compute Engine Compat Manager'
2929
30+ $core_enabled = " C:\ProgramData\Google\Compute Engine\google-guest-agent\core-plugin-enabled"
31+
3032$initial_config = @'
3133# GCE Instance Configuration
3234
@@ -102,8 +104,15 @@ try {
102104 }
103105
104106 if ($install_manager ) {
105- & sc.exe config $name start= disabled
106- Stop-Service $name
107+ # If core plugin is disabled, honor the setting and restart non-plugin based agent.
108+ if (Get-Content - Path $core_enabled - ErrorAction SilentlyContinue | Select-String - Pattern " false" - Quiet) {
109+ Restart-Service $name - Verbose
110+ }
111+ else {
112+ & sc.exe config $name start= disabled
113+ Stop-Service $name
114+ }
115+
107116 Restart-Service $compat_manager - Verbose
108117 Restart-Service $manager_name - Verbose
109118 } else {
You can’t perform that action at this time.
0 commit comments