Azure / Azure/ArcEnabledServersGroupPolicy
Local version detection of installed Azure Arc version not working in Windows 2012 R2
- Dominant language
- PowerShell
- Stars
- 17
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
When the script EnableAzureArc.ps1 is checking for the installed version of Azure Arc in windows 2012 it doesn't properly convert from json in the function Get-ArcAgentStatus.
This is the error I get on all windows 2012 R2 that already have Arc installed when the script runs this command
"[Version]$LocalAgentVersion = (Get-ArcAgentstatus).Agentversion":
"ConvertFrom-Json : Invalid object passed in, ':' or '}' expected. (1): {"
Instead of this "[Version]$LocalAgentVersion = (Get-ArcAgentstatus).Agentversion" a fix I applied is did was these:
[Version]$LocalAgentVersion = (& "$($env:ProgramW6432)\AzureConnectedMachineAgent\azcmagent.exe" --version) -split '(?=\d)',2)[1]
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in EnableAzureArc.ps1 at Get-ArcAgentStatus and reproduce the failure from the [Version]$LocalAgentVersion = (Get-ArcAgentstatus).Agentversion command on Windows Server 2012 R2. Compare its JSON conversion with the reported azcmagent.exe --version result, and verify that installed Arc version detection completes successfully on the affected systems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100