Skip to content

fix: remove misleading 'Bearer ' prefix from -BearerToken/-Token CBH examples#909

Open
pavankadabala-png wants to merge 9 commits into
d365collaborative:masterfrom
pavankadabala-png:fix/666-bearer-token-examples
Open

fix: remove misleading 'Bearer ' prefix from -BearerToken/-Token CBH examples#909
pavankadabala-png wants to merge 9 commits into
d365collaborative:masterfrom
pavankadabala-png:fix/666-bearer-token-examples

Conversation

@pavankadabala-png

Copy link
Copy Markdown
Contributor

Several LCS cmdlets had CBH .EXAMPLE blocks showing -BearerToken and -Token parameters with a "Bearer " prefix in the placeholder value:

-BearerToken "Bearer JldjfafLJdfjlfsalfd..."

The correct form is the raw token only:

-BearerToken "JldjfafLJdfjlfsalfd..."

The three public cmdlets (Invoke-D365LcsUpload, Get-D365LcsDeploymentStatus, Invoke-D365LcsDeployment) already contain normalization code that auto-prepends "Bearer " when the parameter does not start with it. The examples therefore implied an unnecessary prefix that could mislead users into double-prefixing tokens or authentication errors.

Changed: 3 public cmdlets + 6 internal functions — .EXAMPLE / .PARAMETER description text only.
Not changed: normalization code (StartsWith("Bearer ") guard) — left intact for backward compatibility.
invoke-requesthandler.ps1 excluded — its example passes Authorization header directly, which is correct.

Closes #666

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

Successfully merging this pull request may close these issues.

Fix examples with -BearerToken parameter

1 participant