Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix examples with -BearerToken parameter #666

Open
FH-Inway opened this issue Jul 10, 2022 · 1 comment
Open

Fix examples with -BearerToken parameter #666

FH-Inway opened this issue Jul 10, 2022 · 1 comment

Comments

@FH-Inway
Copy link
Member

It seems that several cmdlets with a -BearerToken parameter have examples with an incorrect specification of the parameter.

For example, Invoke-D365LcsUpload has the following example:

PS C:\> Invoke-D365LcsUpload -ProjectId 123456789 -BearerToken "Bearer JldjfafLJdfjlfsalfd..." -FilePath "C:\temp\d365fo.tools\Release-2019-05-05.zip" -FileType "SoftwareDeployablePackage" -Name "Release-2019-05-05" -Filename "Release-2019-05-05.zip" -FileDescription "Build based on sprint: SuperSprint-1" -LcsApiUri "https://lcsapi.lcs.dynamics.com"

Note the -BearerToken "Bearer JldjfafLJdfjlfsalfd..." part with the "Bearer " prefix in front of the actual token value. When executing the cmdlet in this style with valid values, this results in an error:

VERBOSE: [05:33:45][Start-LcsUploadV2] Invoke LCS request.
VERBOSE: POST https://lcsapi.lcs.dynamics.com/box/fileasset/CreateFileAsset/123456789 with -1-byte payload
[05:33:46][Start-LcsUploadV2] Error status code Forbidden in starting a new deployment in LCS. Forbidden. | The remote server returned an error: (403) Forbidden.
WARNING: [05:33:46][Start-LcsUploadV2] Stopping because of errors

If the cmdlet is called without the "Bearer " prefix, the execution is successful.

Note that there are cmdlets where the parameter is specified without the "Bearer " prefix in the examples, e.g. Get-D365LcsDatabaseBackups

PS C:\> Get-D365LcsDatabaseBackups -ProjectId 123456789 -BearerToken "JldjfafLJdfjlfsalfd..." -LcsApiUri "https://lcsapi.lcs.dynamics.com"

The cmdlets with wrong examples are:

Internal cmdlets

@Splaxi
Copy link
Collaborator

Splaxi commented Jul 11, 2022

Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants