SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
235 stars 67 forks source link

Export / Import config #309

Open thomasbonsirven opened 4 years ago

thomasbonsirven commented 4 years ago

Hello,

I have export my config to json, via the command line : Export-PSGSuiteConfig -path .\export.json This command create a json file. Other pc, same version to PSGSuite, i lunch this command : Import-PSGSuiteConfig -Json .\export.json and return this error : Import-PSGSuiteConfig : Primitive JSON non valide : C.

Please is possible to help me !

FISHMANPET commented 4 years ago

What does the outputted JSON file look like? I'm guessing by the error message your computer is using French, do you have any non-ascii characters in your config? PowerShell doesn't seem to do a great job with non-standard characters when converting to JSON, so it could be producing malformed JSON when it tries to export your Config.

thomasbonsirven commented 4 years ago

Hello,

Yes it's a french computer.

Look my json, it great : (I have voluntarily changed information ... but the structure is the same)

{"ConfigName":"MyConfig","P12Key":null,"ClientSecrets":"{\"installed\":{\"client_id\":\"idsecret.apps.googleusercontent.com\",\"project_id\":\"ordinal-avatar-45789\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"token_uri\":\"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"client_secret\":\"clientsecret\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"http://localhost\"]}}","AppEmail":null,"AdminEmail":"mail@mail.ma","CustomerID":null,"Domain":null,"Preference":null}

thomasbonsirven commented 2 years ago

Hello,

Any update please !

thomasbonsirven commented 2 years ago

New element : Impossible to validate the "Preference" Element.... Why ?

Lastest version used