Skip to content

Commit

Permalink
Merge pull request #804 from d365collaborative/development
Browse files Browse the repository at this point in the history
Version: 0.7.9
  • Loading branch information
Splaxi authored Jan 24, 2024
2 parents 3007383 + 49e3cb3 commit 0528b0c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 24 deletions.
12 changes: 6 additions & 6 deletions d365fo.tools/bin/d365fo.tools-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3659,7 +3659,7 @@
},
{
"CommandName": "Get-D365LcsEnvironmentRsatCertificate",
"Description": "Get all meta data details for environments from within a LCS project\n\nIt supports listing all environments, but also supports single / specific environments by searching based on EnvironmentId or EnvironmentName",
"Description": "Download and persist the active rsat certificate from environments from within a LCS project",
"Params": [
[
"ProjectId",
Expand Down Expand Up @@ -3728,10 +3728,10 @@
],
"Alias": "",
"Author": "Mötz Jensen (@Splaxi)",
"Synopsis": "Get LCS environment meta data from within a project",
"Synopsis": "Get LCS environment rsat certificate from within a project",
"Name": "Get-D365LcsEnvironmentRsatCertificate",
"Links": null,
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eGet-D365LcsEnvironmentRsatCertificate -ProjectId \"123456789\" -EnvironmentId \"13cc7700-c13b-4ea3-81cd-2d26fa72ec5e\"\nThis will download the active rsat certificate file for the environment from the LCS project.\r\nThe LCS project is identified by the ProjectId 123456789, which can be obtained in the LCS portal.\r\nThe environment is identified by the EnvironmentId \"13cc7700-c13b-4ea3-81cd-2d26fa72ec5e\", which can be obtained in the LCS portal.\nA result set example:\nPath : c:\\temp\\d365fo.tools\\RsatCert\\RSATCertificate_ABC-UAT_20240101-012030\r\nCerFile : C:\\temp\\d365fo.tools\\RsatCert\\RSATCertificate_ABC-UAT_20240101-012030\\RSATCertificate_ABC-UAT_20240101-012030.cer\r\nPfxFile : C:\\temp\\d365fo.tools\\RsatCert\\RSATCertificate_ABC-UAT_20240101-012030\\RSATCertificate_ABC-UAT_20240101-012030.pfx\r\nFileName : RSATCertificate_ABC-UAT_20240101-012030.zip\r\nPassword : 9zbPiLMTk676mkq5FvqQ",
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eGet-D365LcsEnvironmentRsatCertificate -ProjectId \"123456789\" -EnvironmentId \"13cc7700-c13b-4ea3-81cd-2d26fa72ec5e\"\nThis will download the active rsat certificate file for the environment from the LCS project.\r\nThe LCS project is identified by the ProjectId 123456789, which can be obtained in the LCS portal.\r\nThe environment is identified by the EnvironmentId \"13cc7700-c13b-4ea3-81cd-2d26fa72ec5e\", which can be obtained in the LCS portal.\nA result set example:\nPath : c:\\temp\\d365fo.tools\\RsatCert\\RSATCertificate_ABC-UAT_20240101-012030\r\nCerFile : C:\\temp\\d365fo.tools\\RsatCert\\RSATCertificate_ABC-UAT_20240101-012030\\RSATCertificate_ABC-UAT_20240101-012030.cer\r\nPfxFile : C:\\temp\\d365fo.tools\\RsatCert\\RSATCertificate_ABC-UAT_20240101-012030\\RSATCertificate_ABC-UAT_20240101-012030.pfx\r\nFileName : RSATCertificate_ABC-UAT_20240101-012030.zip\r\nPassword : 9zbPiLMTk676mkq5FvqQ\n-------------------------- EXAMPLE 2 --------------------------\nPS C:\\\u003eGet-D365LcsEnvironmentRsatCertificate -ProjectId \"123456789\" -EnvironmentId \"13cc7700-c13b-4ea3-81cd-2d26fa72ec5e\" | Import-D365RsatSelfServiceCertificates\nThis will download the active rsat certificate file for the environment from the LCS project.\r\nThe resulting files are then imported into the certificate store on the local machine.",
"Syntax": "Get-D365LcsEnvironmentRsatCertificate [[-ProjectId] \u003cInt32\u003e] [[-BearerToken] \u003cString\u003e] [-EnvironmentId] \u003cString\u003e [[-OutputPath] \u003cString\u003e] [[-LcsApiUri] \u003cString\u003e] [-FailOnErrorMessage] [[-RetryTimeout] \u003cTimeSpan\u003e] [-EnableException] [\u003cCommonParameters\u003e]"
},
{
Expand Down Expand Up @@ -5858,15 +5858,15 @@
"Path to the folder where the .cer and .pxf files are located\nThe files needs to be extracted from the zip archive",
"",
true,
"false",
"true (ByPropertyName)",
""
],
[
"Password",
"Password for the .pxf file\nWorking with self-service environments, the password will be displayed during the download of the zip archive",
"",
true,
"false",
"true (ByPropertyName)",
""
]
],
Expand All @@ -5875,7 +5875,7 @@
"Synopsis": "Import certificates for RSAT",
"Name": "Import-D365RsatSelfServiceCertificates",
"Links": null,
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eImport-D365RsatSelfServiceCertificates -Path \"C:\\Temp\\UAT\" -Password \"123456789\"\nThis will import the .cer and .pxf files into the correct stored, bases on the files located in \"C:\\Temp\\UAT\".\r\nAfter import it will display the thumbprint for both certificates.\nSample output:\r\n[23:43:05][Import-D365RsatSelfServiceCertificates] Pfx Thumbprint: B4D6921321434235463463414312343253523A05\r\n[23:43:05][Import-D365RsatSelfServiceCertificates] Cert Thumbprint: B4D6921321434235463463414312343253523A05",
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eImport-D365RsatSelfServiceCertificates -Path \"C:\\Temp\\UAT\" -Password \"123456789\"\nThis will import the .cer and .pxf files into the correct store, bases on the files located in \"C:\\Temp\\UAT\".\r\nAfter import it will display the thumbprint for both certificates.\nSample output:\r\n[23:43:05][Import-D365RsatSelfServiceCertificates] Pfx Thumbprint: B4D6921321434235463463414312343253523A05\r\n[23:43:05][Import-D365RsatSelfServiceCertificates] Cert Thumbprint: B4D6921321434235463463414312343253523A05",
"Syntax": "Import-D365RsatSelfServiceCertificates [-Path] \u003cObject\u003e [-Password] \u003cObject\u003e [\u003cCommonParameters\u003e]"
},
{
Expand Down
2 changes: 1 addition & 1 deletion d365fo.tools/d365fo.tools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'd365fo.tools.psm1'

# Version number of this module.
ModuleVersion = '0.7.8'
ModuleVersion = '0.7.9'

# ID used to uniquely identify this module
GUID = '7c7b26d4-f764-4cb0-a692-459a0a689dbb'
Expand Down
2 changes: 1 addition & 1 deletion d365fo.tools/d365fo.tools.psm1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$script:ModuleRoot = $PSScriptRoot
$script:ModuleVersion = "0.7.8"
$script:ModuleVersion = "0.7.9"

# Detect whether at some level dotsourcing was enforced
$script:doDotSource = Get-PSFConfigValue -FullName d365fo.tools.Import.DoDotSource -Fallback $false
Expand Down
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 0528b0c

Please sign in to comment.