-
Notifications
You must be signed in to change notification settings - Fork 69
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
Error processing property 'Credential' OF TYPE 'PfxImport' #217
Comments
Hi @Harshinee, |
I have another question about installing the module. I tried a few things,
|
Hi @Harshinee - Ok, here's my suggestions:
If there is an error Installing the Nuget Package Provider then you have bigger problems than DSC (it is a problem with the PowerShell setup on your machine) - so you'll need to fix that first. There will be lots of solutions around the internet for this depending on what error you're seeing. Finally, I'd question, are you compiling the DSC Config on the node you're planning to deploy the configuration to or are you doing it on a different machine? Generally if you're compiling on one machine and then deploying the MOF to another machine (e.g. using a DSC Pull server or Azure DSC Extension) then you'll be getting the DSC Resource modules onto the machine another way. But I'd expect your script to be more like: Configuration NodeComponentsDsc
{
param (
[System.Management.Automation.PSCredential]$SPSecret,
[System.Management.Automation.PSCredential]$SasToken,
$TenantId,
$ApplicationId,
$KeyVaultName,
$TorusCertificateName,
$KevlarCertificateName,
$StorageAccountName,
$ContainerName,
$NugetPackageBlobName,
$KevlarSettingsBlobName,
$HnsProxyBlobName,
$ScriptsBlobName
)
$Logfile = "C:\InstallExtensions.log"
Start-Transcript -Path $Logfile
Write-Output 'Writing some text to the log file'
Import-DSCResource -ModuleName PSDesiredStateConfiguration
Import-DSCResource -ModuleName CertificateDsc
Node ($env:COMPUTERNAME)
{
# Removed for brevity
}
}
# Install dependent modules
Find-Module -Name CertificateDsc -Repository PSGallery | Install-Module -Force
# Compile the MOF
NodeComponentsDsc `
-OutputPath 'C:\Whereever\' `
-SPSecret $SPSecret `
-SasToken $SasToken `
... Note: if you're deploying this to Azure via the DSC Extension, this won't work (as you just want to include the Config and the Modules need to be included in the zip file as is). If you are trying to install this into an Azure VM, let me know - because I've been meaning to write a blog post on doing this because the docs aren't as clear as they could be. |
Hi @Harshinee - can I close this one? |
ISSUE TITLE:
PfxImport: Error processing property 'Credential' OF TYPE 'PfxImport''
ISSUE DESCRIPTION (this template):
I'm trying to import a certificate using PfxImport. Fails with the following error,
System.InvalidOperationException error processing property 'Credential' OF TYPE 'PfxImport': Converting and storing encrypted passwords as plain text is not recommended. For more information on securing credentials in MOF file, please refer to MSDN blog: http://go.microsoft.com/fwlink/?LinkId=393729 At C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.0.0\DSCWork\NodeComponentDscNoKevlar.0\InstallExtensions.ps1:36 char:9 + PfxImport Converting and storing encrypted passwords as plain text is not recommended. For more information on securing credentials in MOF file, please refer to MSDN blog: http://go.microsoft.com/fwlink/?LinkId=393729 Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\3\DSC' because it does not exist. Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\3\DSC' because it does not exist. Unable to find type [System.Net.Http.HttpClient]. Unable to find type [System.Net.Http.HttpClient]. Unable to find type [Microsoft.PowerShell.Commands.PowerShellGet.Telemetry]. Another common error is to specify parameters of type PSCredential without an explicit type. Please be sure to use a typed parameter in DSC Configuration, for example: configuration Example { param([PSCredential] $UserAccount) ... }. Please correct the input and retry executing the extension.
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
4.7.0.0
I have attached my dsc configuration file for reference.
InstallExtensions.txt
The text was updated successfully, but these errors were encountered: