Closed stuartahonour closed 3 years ago
Hi.
You need to have an account and a registered application in place.
You can read this wiki, to get the prerequisite in place and then return to the environment Metadata.
https://github.com/d365collaborative/d365fo.tools/wiki/How-To-Download-Latest-Bacpac-From-Lcs
Hi
Ok managed to get it to work by getting a bearerToken and using the folloiwng
Get-D365LcsEnvironmentMetadata -ProjectId "{ProjectID}" -LCSApiUri "https://lcsapi.lcs.dynamics.com" -TraverseAllPages -EnableException -BearerToken $Token
So now i just need to parse the output into a table
.... | FT
will do that for you.
When using just |FT the output gets truncated
I also get these messages when running the command
Get-D365LcsEnvironmentMetadata -ProjectId $ProjectId -LCSApiUri "https://lcsapi.lcs.dynamics.com" -TraverseAllPages -EnableException -BearerToken $Token |FT
[09:12:05][
I assume this is because I'm running this on a none F&O Server?
Here is the truncated output when using just |FT
Yes to the first question.
For the truncation, that is something you should look for within the powershell community and blog posts. I don't know your requirements and what you are trying to solve, but I'm confident that most things should be possible...
If you could explain what you're trying to achieve and what format you want the data / output to be in, I might be able to give a few and better pointers / directions.
Let me know if you need anything else.
Trying to use Get-D365LcsEnvironmentMetadata -ProjectId "{Project ID Removed}" -LCSApiUri "https://lcsapi.lcs.dynamics.com" -TraverseAllPages -EnableException
It get the following Error
[Get-LcsEnvironmentMetadata] Error status code Unauthorized in request for getting the environment metadata a project in LCS. Unauthorized. | The remote server returned an error: (401) Unauthorized. WARNING: [16:49:59][Get-LcsEnvironmentMetadata] Stopping because of errors Exception calling "AddRange" with "1" argument(s): "Value cannot be null. Parameter name: collection" At line:15163 char:13
Is this because I'm not setting the -BearerToken
How do I get the authentication to work?