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:
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]