Skip to content

Commit

Permalink
Merge pull request #803 from FH-Inway/fix-copy-paste-documentation
Browse files Browse the repository at this point in the history
Fix documentation and enable pipeline from download to import
  • Loading branch information
Splaxi authored Jan 24, 2024
2 parents 0df947a + 2983338 commit 0625f60
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
12 changes: 8 additions & 4 deletions d365fo.tools/functions/get-d365lcsenvironmentrsatcertificate.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

<#
.SYNOPSIS
Get LCS environment meta data from within a project
Get LCS environment rsat certificate from within a project
.DESCRIPTION
Get all meta data details for environments from within a LCS project
It supports listing all environments, but also supports single / specific environments by searching based on EnvironmentId or EnvironmentName
Download and persist the active rsat certificate from environments from within a LCS project
.PARAMETER ProjectId
The project id for the Dynamics 365 for Finance & Operations project inside LCS
Expand Down Expand Up @@ -86,6 +84,12 @@
FileName : RSATCertificate_ABC-UAT_20240101-012030.zip
Password : 9zbPiLMTk676mkq5FvqQ
.EXAMPLE
PS C:\> Get-D365LcsEnvironmentRsatCertificate -ProjectId "123456789" -EnvironmentId "13cc7700-c13b-4ea3-81cd-2d26fa72ec5e" | Import-D365RsatSelfServiceCertificates
This will download the active rsat certificate file for the environment from the LCS project.
The resulting files are then imported into the certificate store on the local machine.
.NOTES
Author: Mötz Jensen (@Splaxi)
#>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.EXAMPLE
PS C:\> Import-D365RsatSelfServiceCertificates -Path "C:\Temp\UAT" -Password "123456789"
This will import the .cer and .pxf files into the correct stored, bases on the files located in "C:\Temp\UAT".
This will import the .cer and .pxf files into the correct store, bases on the files located in "C:\Temp\UAT".
After import it will display the thumbprint for both certificates.
Sample output:
Expand All @@ -37,10 +37,14 @@ function Import-D365RsatSelfServiceCertificates {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[Parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName)]
$Path,

[Parameter(Mandatory = $true)]
[Parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName)]
$Password
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $True
$parameter.ParameterSets['__AllParameterSets'].Position | Should -Be 0
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $True
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
It 'Should have the expected parameter Password' {
Expand All @@ -34,7 +34,7 @@
$parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $True
$parameter.ParameterSets['__AllParameterSets'].Position | Should -Be 1
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $True
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
}
Expand Down
14 changes: 10 additions & 4 deletions docs/Get-D365LcsEnvironmentRsatCertificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ schema: 2.0.0
# Get-D365LcsEnvironmentRsatCertificate

## SYNOPSIS
Get LCS environment meta data from within a project
Get LCS environment rsat certificate from within a project

## SYNTAX

Expand All @@ -19,9 +19,7 @@ Get-D365LcsEnvironmentRsatCertificate [[-ProjectId] <Int32>] [[-BearerToken] <St
```

## DESCRIPTION
Get all meta data details for environments from within a LCS project

It supports listing all environments, but also supports single / specific environments by searching based on EnvironmentId or EnvironmentName
Download and persist the active rsat certificate from environments from within a LCS project

## EXAMPLES

Expand All @@ -42,6 +40,14 @@ PfxFile : C:\temp\d365fo.tools\RsatCert\RSATCertificate_ABC-UAT_20240101-012030
FileName : RSATCertificate_ABC-UAT_20240101-012030.zip
Password : 9zbPiLMTk676mkq5FvqQ

### EXAMPLE 2
```
Get-D365LcsEnvironmentRsatCertificate -ProjectId "123456789" -EnvironmentId "13cc7700-c13b-4ea3-81cd-2d26fa72ec5e" | Import-D365RsatSelfServiceCertificates
```

This will download the active rsat certificate file for the environment from the LCS project.
The resulting files are then imported into the certificate store on the local machine.

## PARAMETERS

### -ProjectId
Expand Down
6 changes: 3 additions & 3 deletions docs/Import-D365RsatSelfServiceCertificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The zip file needs to be unblocked and then extracted into a folder, with only t
Import-D365RsatSelfServiceCertificates -Path "C:\Temp\UAT" -Password "123456789"
```

This will import the .cer and .pxf files into the correct stored, bases on the files located in "C:\Temp\UAT".
This will import the .cer and .pxf files into the correct store, bases on the files located in "C:\Temp\UAT".
After import it will display the thumbprint for both certificates.

Sample output:
Expand All @@ -51,7 +51,7 @@ Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
Expand All @@ -68,7 +68,7 @@ Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
Expand Down

0 comments on commit 0625f60

Please sign in to comment.