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 import rsat certificate pipeline #87

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions d365fo.tools/functions/import-d365rsatselfservicecertificates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,26 @@ function Import-D365RsatSelfServiceCertificates {
param (
[Parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName)]
$Path,
ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[string] $Path,

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

begin {
[Security.SecureString] $PasswordSecure = (ConvertTo-SecureString -String $Password -Force -AsPlainText)

if (-not (Test-PathExists -Path $Path -Type Container)) { return }

}

process {
[Security.SecureString] $PasswordSecure = (ConvertTo-SecureString -String $Password -Force -AsPlainText)

if (-not (Test-PathExists -Path $Path -Type Container)) { return }

if (Test-PSFFunctionInterrupt) { return }

$pathCertFile = (Get-ChildItem -Path "$Path\*.cer" | Select-Object -First 1).FullName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
It 'Should have the expected parameter Path' {
$parameter = (Get-Command Import-D365RsatSelfServiceCertificates).Parameters['Path']
$parameter.Name | Should -Be 'Path'
$parameter.ParameterType.ToString() | Should -Be System.Object
$parameter.ParameterType.ToString() | Should -Be System.String
$parameter.IsDynamic | Should -Be $False
$parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
$parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
Expand All @@ -27,7 +27,7 @@
It 'Should have the expected parameter Password' {
$parameter = (Get-Command Import-D365RsatSelfServiceCertificates).Parameters['Password']
$parameter.Name | Should -Be 'Password'
$parameter.ParameterType.ToString() | Should -Be System.Object
$parameter.ParameterType.ToString() | Should -Be System.String
$parameter.IsDynamic | Should -Be $False
$parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
$parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
Expand Down
6 changes: 3 additions & 3 deletions docs/Import-D365RsatSelfServiceCertificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Import certificates for RSAT
## SYNTAX

```
Import-D365RsatSelfServiceCertificates [-Path] <Object> [-Password] <Object> [<CommonParameters>]
Import-D365RsatSelfServiceCertificates [-Path] <String> [-Password] <String> [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -44,7 +44,7 @@ Path to the folder where the .cer and .pxf files are located
The files needs to be extracted from the zip archive

```yaml
Type: Object
Type: String
Parameter Sets: (All)
Aliases:

Expand All @@ -61,7 +61,7 @@ Password for the .pxf file
Working with self-service environments, the password will be displayed during the download of the zip archive
```yaml
Type: Object
Type: String
Parameter Sets: (All)
Aliases:

Expand Down
Loading