dear all,
when i run this script form Doctor Scripto:
# Get Teams Configuration
$FileContent=Get-Content -Path "$ENV:APPDATA\Microsoft\Teams\desktop-config.json"
# Convert file content from JSON format to PowerShell object
$JSONObject=ConvertFrom-Json -InputObject $FileContent # <--- error
# Update Object settings
$JSONObject.appPreferenceSettings.OpenAsHidden=$true
$JSONObject.appPreferenceSettings.OpenAtLogin=$true
$JSONObject.appPreferenceSettings.RunningOnClose=$False
Get-Process Teams | Stop-Process -Force
# Convert Object back to JSON format
$NewFileContent=$JSONObject | ConvertTo-Json
# Update configuration in file
$NewFileContent | Set-Content -Path "$ENV:APPDATA\Microsoft\Teams\desktop-config.json"
I keep on getting the fooling error and i cannot figure out what is going wrong:
ConvertFrom-Json : Ongeldige JSON-primitieve: C.
At line:4 char:13
+ $JSONObject=ConvertFrom-Json -InputObject $FileContent
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
the variable $FileContent contains the content of $ENV:APPDATA\Microsoft\Teams\desktop-config.json
can someone help me out?