Jump to content
percubabs

modification d'un fichier de configuration en Powershell

Recommended Posts

Bonjour,

J'ai besoin de modifier un fichier de configuration logiciel, TEAMS

Le fichier de configuration  :

%appdata%\Microsoft\Teams\desktop-config.json
{"preventUpnDetectSso":false,"silentUpdateTriggered":false,"previousCrashesInfo":{"crashes":[]},"windowState":{"monitorId":*,"x":768,"y":0,"width":768,"height":920,"isMaximized":true,"isFullScreen":false},"restartCommand":{},"userUpn":"","userOid":"*","userTid":"*","guestTenantId":"","homeTenantId":"*","launchTime":"*","desktopZoomLevelV2":3,"isAppFirstRun":false,"overrideOpenAsHiddenProperty":true,"desktopSessionId":"*","teamsUrlProtocolsRegistered":true,"lyncUrlProtocolsRegistered":true,"disableWarningOnOpenKeyRegistered":true,"isPrivateCloud":false,"machineId":"***","deviceInfoId":"**","restartReason":null,"currentWebLanguage":"fr","appPreferenceSettings":{"openAsHidden":true,"openAtLogin":false,"registerAsIMProvider":true,"runningOnClose":true},"isLoggedOut":false,"pastModernAuthSucceeded":true,"previousWebClientVersion":"*","isForeground":false,"isAppSessionEnd":false,"notificationWindowOnClose":true,"isAppTerminated":false}

Mon problème est que les valeurs son entre guillemets et me plante ma commande replace

{ $_ -replace ""******":false",""*******":true" }

Est ce que vous pourriez m'aider?

Merci

Share this post


Link to post
Share on other sites

bon comme d'habitude je trouve quand je poste.

(Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '"*****":false','"*****":true'| Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...