From 3b2f33ba64e83eaa207d5ca0376a65d3c33bdd0f Mon Sep 17 00:00:00 2001 From: Immanuel Smits Date: Thu, 27 Jun 2024 11:12:42 -0400 Subject: [PATCH 1/4] Adding jsonDescription --- d365fo.tools/internal/functions/start-lcsuploadv2.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 index 1ad65a20..0fc8a3eb 100644 --- a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 +++ b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 @@ -119,6 +119,13 @@ function Start-LcsUploadV2 { begin { Invoke-TimeSignal -Start + if ($Description) { + $jsonDescription = $Description + } + else { + $jsonDescription = $null + } + $fileTypeValue = [int]$FileType $jsonPayload = @{ Name = $Name From 787fd8226b9df2b167152d0f8a2c5419e7790cc3 Mon Sep 17 00:00:00 2001 From: Immanuel Smits Date: Thu, 27 Jun 2024 11:13:17 -0400 Subject: [PATCH 2/4] Correcting Token parameter --- d365fo.tools/internal/functions/start-lcsuploadv2.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 index 0fc8a3eb..a51513ca 100644 --- a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 +++ b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 @@ -95,7 +95,8 @@ function Start-LcsUploadV2 { [Cmdletbinding()] param( [Parameter(Mandatory = $true)] - [string] $Token, + [Alias('Token')] + [string] $BearerToken, [Parameter(Mandatory = $true)] [int] $ProjectId, From 3de5fc0e8ba8bd5a7e1b3ca958e4045ce78dc710 Mon Sep 17 00:00:00 2001 From: Immanuel Smits Date: Thu, 27 Jun 2024 11:30:42 -0400 Subject: [PATCH 3/4] Correcting parameter help for BearerToken --- d365fo.tools/internal/functions/start-lcsuploadv2.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 index a51513ca..0cd9c6d5 100644 --- a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 +++ b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 @@ -6,8 +6,8 @@ .DESCRIPTION Start the flow of actions to upload a file to LCS - .PARAMETER Token - The token to be used for the http request against the LCS API + .PARAMETER BearerToken + The token you want to use when working against the LCS api .PARAMETER ProjectId The project id for the Dynamics 365 for Finance & Operations project inside LCS From b7fee3344ed82f06ba78567a4c7834ac67d1d284 Mon Sep 17 00:00:00 2001 From: Immanuel Smits Date: Thu, 27 Jun 2024 14:57:58 -0400 Subject: [PATCH 4/4] Using the Directory parameter directly in the params --- d365fo.tools/internal/functions/start-lcsuploadv2.ps1 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 index 0cd9c6d5..e3c29d40 100644 --- a/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 +++ b/d365fo.tools/internal/functions/start-lcsuploadv2.ps1 @@ -120,18 +120,11 @@ function Start-LcsUploadV2 { begin { Invoke-TimeSignal -Start - if ($Description) { - $jsonDescription = $Description - } - else { - $jsonDescription = $null - } - $fileTypeValue = [int]$FileType $jsonPayload = @{ Name = $Name FileName = $Filename - FileDescription = $jsonDescription + FileDescription = $Description SizeByte = 0 FileType = $fileTypeValue } | ConvertTo-Json