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

Added xCertificateExport Resource - Fixes #41 #48

Merged
merged 38 commits into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6e029a7
First cut at xCertificateExport
PlagueHO Jan 21, 2017
0be85e2
First cut at adding xCertificateExport and other misc style fixes and…
PlagueHO Jan 22, 2017
e0bf78c
Update readme.md
PlagueHO Jan 22, 2017
3744b92
Fix up PSD1
PlagueHO Jan 22, 2017
ab9e97a
Added Find-Certificate function
PlagueHO Feb 10, 2017
c5b41f0
Fix AppVeyor function names
PlagueHO Feb 10, 2017
7808557
Fix tests
PlagueHO Feb 10, 2017
83217f4
Clean up xCertificate.psd1
PlagueHO Feb 10, 2017
cee74af
Correct readme.md
PlagueHO Feb 10, 2017
db30eec
Add unit tests for Find-Certificate
PlagueHO Feb 11, 2017
9f4e298
Fix up Find-Certificate tests to run in AppVeyor
PlagueHO Feb 11, 2017
6ff0e37
More tests added for Find-Certificate and a bug fix
PlagueHO Feb 11, 2017
671c48b
Unit tests for Find-Certificate complete
PlagueHO Feb 11, 2017
cb5facb
Integration tests completed
PlagueHO Feb 12, 2017
eaddeb6
Fix bug with Set-TargetResource returning boolean
PlagueHO Feb 12, 2017
3eabeeb
Fix integration tests
PlagueHO Feb 12, 2017
0b2123e
Fix up examples
PlagueHO Feb 12, 2017
6026313
Added code to ensure matchsource works
PlagueHO Feb 12, 2017
f81eed3
Added unit tests and minor fixes
PlagueHO Feb 12, 2017
b48cac9
More unit tests added
PlagueHO Feb 12, 2017
aac90f1
Improve coverage
PlagueHO Feb 12, 2017
5917bd7
Final unit tests added
PlagueHO Feb 12, 2017
b5b6b01
Added OptIn file and updated readme.md
PlagueHO Feb 12, 2017
5915fc6
Correct Optin File
PlagueHO Feb 12, 2017
faaf156
Changes as per PR comments
PlagueHO Feb 15, 2017
1a10d7f
Renamed test files to fix filename case
PlagueHO Feb 16, 2017
07d30f8
Renamed test files back
PlagueHO Feb 16, 2017
99fdb98
Remove unneeded call
PlagueHO Feb 17, 2017
de77a9e
Changes as per PR comments
PlagueHO Feb 24, 2017
d150798
Fix break
PlagueHO Feb 24, 2017
9badda6
Changes as per PR comments
PlagueHO Feb 26, 2017
128ccb9
More changes as per PR comments
PlagueHO Feb 26, 2017
f9bb85c
More fixes as per PR comments
PlagueHO Feb 27, 2017
c8a3ebb
More fixes as per PR comments
PlagueHO Feb 27, 2017
250b0eb
Even more changes as per PR comments
PlagueHO Feb 27, 2017
fa4d8ab
Final changes as per PR comments
PlagueHO Feb 27, 2017
7371593
Final changes as per PR
PlagueHO Feb 28, 2017
4234e25
Final tweaks as per PR commnets
PlagueHO Mar 1, 2017
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
3 changes: 3 additions & 0 deletions .MetaTestOptIn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"Common Tests - Validate Markdown Files"
]

This file was deleted.

35 changes: 10 additions & 25 deletions DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
#Requires -Version 4.0

#region localizeddata
if (Test-Path "${PSScriptRoot}\${PSUICulture}")
{
Import-LocalizedData `
-BindingVariable LocalizedData `
-Filename MSFT_xCertReq.strings.psd1 `
-BaseDirectory "${PSScriptRoot}\${PSUICulture}"
}
else
{
#fallback to en-US
Import-LocalizedData `
-BindingVariable LocalizedData `
-Filename MSFT_xCertReq.strings.psd1 `
-BaseDirectory "${PSScriptRoot}\en-US"
}
#endregion

# Import the common certificate functions
Import-Module -Name ( Join-Path `
-Path (Split-Path -Path $PSScriptRoot -Parent) `
-ChildPath 'CertificateCommon\CertificateCommon.psm1' )
$script:ResourceRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent)

# Import the xCertificate Resource Module (to import the common modules)
Import-Module -Name (Join-Path -Path $script:ResourceRootPath -ChildPath 'xCertificate.psd1')

# Import Localization Strings
$localizedData = Get-LocalizedData `
-ResourceName 'MSFT_xCertReq' `
-ResourcePath (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)

<#
.SYNOPSIS
Expand Down Expand Up @@ -388,7 +375,7 @@ RenewalCert = $Thumbprint
# SUBMIT: Submit a request to a Certification Authority.
# DSC runs in the context of LocalSystem, which uses the Computer account in Active Directory
# to authenticate to network resources
# The Credential paramter with xPDT is used to impersonate a user making the request
# The Credential paramter with PDT is used to impersonate a user making the request
if (Test-Path -Path $reqPath)
{
Write-Verbose -Message ( @(
Expand All @@ -398,8 +385,6 @@ RenewalCert = $Thumbprint

if ($Credential)
{
Import-Module -Name $PSScriptRoot\..\PDT\PDT.psm1 -Force

# Assemble the command and arguments to pass to the powershell process that
# will request the certificate
$certReqOutPath = [System.IO.Path]::ChangeExtension($workingPath,'.out')
Expand Down
Loading