Git Product home page Git Product logo

dsc's People

Contributors

artwdrahn avatar austinmontoya avatar brettski avatar briantist avatar craig-martin avatar dan1el42 avatar dlwyatt avatar gpduck avatar janegilring avatar jasonmorgan avatar jhofferle avatar jpogran avatar llstrk avatar mdehaas avatar mikepfeiffer avatar ned1313 avatar pcgeek86 avatar rchaganti avatar rohnedwards avatar smurawski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsc's Issues

Break up cDscDiagnostics into individual scripts

I'm currently in the process of writing a bunch of tests for cDscDiagnostics to help me understand Pester better, and aid in making the module better in general (I'm seeing some improvements it could make... ๐Ÿ˜ ). While I'm doing this work does it make sense to break up the functions into individual scripts DscDevelopment has been?

cAppPool - Setting Identity Type to specific user but not username and password

I came across a scenario where I want to set an app pool to use the identity type of 'specific user', but I would like to have the username and password controlled outside of DSC.

The way the resource is written now, if the identity type is set to 'specific user' and the username and password are not set, when the configuration is checked the username is checked to see if matches the current username (which it won't if its been updated manually) the username is reset to 'Specific User'

I have a fixed this locally and can update my Fork of the project for review.

Add tests for DscBuild

There are currently very few tests for Invoke-DscBuild and its various pieces. Part of this is due to how the module currently works, where each function is called with basically no parameters, and information is passed around via script-scope variables instead (in both directions).

It'll be easier to test, and for people to understand the code, if we refactor these so all function input is via parameters and all function output is via the output stream.

Development Branch Examples Missing Folders

I took the examples for a spin and the first thing I ran into was an error saying I was missing the folders Applications and Credentials in the DSC_Configuration folder. Obviously I just created them and kept on going but it would be nice to just have the folders present (maybe with a readme in the folder describing what goes there? I still have no idea how Application gets used).

Add-DscEncryptedPassword functionality

I'm using the Development version.
Is it possible to have different names for credentials besides the user-name. so I have a number of computers with different local admin accounts I need the keys under $ConfigurationData.Credentials to be different.
however as it is, whatever I add as the username also becomes the key.

Invoke-DscBuild causes problems with importing modules.

This is moste apperent with DSC\Development
When Invoke-DscBuild something happens so many modules will no longer load.
in DSC\Master it happens some time after each resource is tested. in DSC\Development it happens before. This brakes pester tests in DSC\Development as pester cant mock a function from a module that cant load.
To replicate the issue. use DSC\Development (I have only cNetworking in my DC_Resorces folder) and run Invoke-DscBuild -Resources. afterwords run Import-Module DnsClient to get the error.

PS H:> Import-Module DnsClient
Import-Module : Cannot process Cmdlet Definition XML for the following file:
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\MSFT_DnsClient.cdxml. At line:363 char:17

  •             $__cmdletization_objectModelWrapper = Microsoft.PowerShell.Utili ...
    
  • Executable script code found in signature block.
    At line:364 char:17
    
  •             $__cmdletization_objectModelWrapper.Initialize($PSCmdlet, $scrip ...
    
  • Executable script code found in signature block.
    At line:368 char:21
    
  •                 ([System.Management.Automation.IDynamicParameters]$__cmdleti ...
    
  • Executable script code found in signature block.
    At line:366 char:17
    
  •             if ($__cmdletization_objectModelWrapper -is [System.Management.A ...
    
  • Executable script code found in signature block.
    At line:361 char:13
    
  •         if (-not $__cmdletization_exceptionHasBeenThrown)
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Executable script code found in signature block.
    At line:374 char:13
  •         $__cmdletization_exceptionHasBeenThrown = $true
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Executable script code found in signature block.
    At line:375 char:13
  •         throw
    
  •         ~~~~~
    
    Executable script code found in signature block.
    At line:359 char:9
  •     try
    
  •     ~~~
    
    Executable script code found in signature block.
    At line:380 char:9
  •     $__cmdletization_exceptionHasBeenThrown = $false
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Executable script code found in signature block.
    At line:383 char:13
  •         __cmdletization_BindCommonParameters $__cmdletization_objectModelWra ...
    
  • Executable script code found in signature block.
    Not all parse errors were reported.  Correct the reported errors and try again.
    At line:1 char:1
    
  • Import-Module DnsClient
  • - CategoryInfo          : NotSpecified: (:) [Import-Module], XmlException
    - FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.PowerShell.Commands.ImportModuleCommand
    

Modules in DSC_Resorces cant be used to manage machine running invoke-DSCBuild.

when I try to update my tools and it brakes I alwase fall back to a clean seutp and the sample build.

when it Trys to run I get some errors I think is related to the recent change of folders, having the resorces in both the DSC_Resorce folder and C:\Program Files\WindowsPowerShell\Modules (required for ISE to validate SampleConfiguration)

VERBOSE: Performing the operation "Test-DscResourceIsValid" on target "modules from H:\DSC\DSC_Tooling\Examples
DSC_Resources".
ImportCimAndScriptKeywordsFromModule : A second CIM class definition for 'PSHOrg_cSmbShare' was found while
processing the schema file 'C:\Program
Files\WindowsPowerShell\Modules\cSmbShare\DSCResources\PSHOrg_cSmbShare\PSHOrg_cSmbShare.Schema.mof'. This
class was already defined in the file 'H:\DSC\DSC_Tooling\Examples\DSC_Resources\cSmbShare\DSCResources\PSHOrg_
cSmbShare\PSHOrg_cSmbShare.Schema.mof'. Remove the redundant definition, and then try again.
At C:\windows\system32\windowspowershell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.p
sm1:2426 char:29

  •                 $null = ImportCimAndScriptKeywordsFromModule -Module $mod -R ...
    
  • - CategoryInfo          : NotSpecified: (:) [Write-Error], PSInvalidOperationException
    - FullyQualifiedErrorId : System.Management.Automation.PSInvalidOperationException,ImportCimAndScriptKeywo 
      rdsFromModule
      .... 
    

Invoke-DscBuild throws error if cNetworking is in DSC_Resources

Invoke-DscBuild ends with this error.

WARNING: Get-TargetResource should return a [Hashtable] mapping all schema properties to their values. Prepend the
param block with [OutputType([Hashtable])].
WARNING: Test-TargetResource should return a [boolean]. Prepend the param block with [OutputType([Boolean])].
WARNING: Get-TargetResource should return a [Hashtable] mapping all schema properties to their values. Prepend the
param block with [OutputType([Hashtable])].
WARNING: Test-TargetResource should return a [boolean]. Prepend the param block with [OutputType([Boolean])].
New-cDscResourceProperty : ValidateSet can not be used for Arrays, PSCredentials, and Hashtable.
At C:\Program Files\WindowsPowerShell\Modules\cDscResourceDesigner\cDscResourceDesigner.psm1:3211 char:24

  •     $properties += New-cDscResourceProperty `
    
  •                    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : InvalidValidateSetUsageError,New-cDscResourceProperty

Invoke-DscBuild tests all modules in the Program Files path

All DSC resources in Program Files\WindowsPowershell\Modules are tested with Test-cDscResource, even if they're not part of the set of modules that are being deployed with Invoke-DscBuild.

A quick an easy way to address this would be to make sure only modules that were copied from the source directory get tested. Another option might be to remove the use of the Program Files directory in Test-DscResourceIsValid, and move that step up before Copy-CurrentDscResource. This would likely be more work, but would allow the resources to be tested in the source folder or a temporary location before any modifications have been made to the Program Files directory, while also avoiding the problem of having other pre-existing modules in Program Files contaminating the Test step.

BindingInformation

In cWebsite configuration i want to add a bindinginfo so that the website runs at a different port, but i don't get it right.
When i use an object of type [CimInstance[]], i get the error:
Write-NodeMOFFile : Invalid MOF definition for node 'node': Exception calling "ValidateInstanceText" with "1" argument(s): "Syntax
error:
At line:376, char:15
Buffer:
nfo = {
CimInstance^
};

"
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:1425 char:17

I have no clue how to solve this, if anyone can help me out, thanks.

cWebsite Bug?

I'm stumbling a bit using cWebsite to create a new site...

 Cannot find path 'IIS:\Sites\MySite' because it does not exist.
 + CategoryInfo          : ObjectNotFound: (IIS:\Sites\MySite:) [], CimException
 + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand
 + PSComputerName        : zapateria

I've been looking at this for a while now and tinkering with the code. The root of the problem seems to be that Get-Website -Name $Name always returns all websites on the server and does not filter by name. So while that seems easy to fix, I wanted to ask about it here because I don't understand how this would ever work. The Resource Kit xWebsite also has the same issue...

Is this a bug for others besides me?

DSC Resource PSHOrg_cADGroup to cActive Directory

Hi Steven,

As requested I filed a new issue. I think the DSC Resource PSHOrg_ADGroup fits in with cActiveDirectory. So you guys will create a folder where I can upload the code right?

Ttyl,

Irwin

cPSGet can't find modules

This is the error that I see when I apply my test configuration:

23# Start-DscConfiguration .\TestConfig\ -Wait -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer HILLR1-VM-VS14B with user sid
S-1-5-21-198358228-527928863-167192953-14732.
VERBOSE: [HILLR1-VM-VS14B]: LCM: [ Start Set ]
VERBOSE: [HILLR1-VM-VS14B]: LCM: [ Start Resource ] [[cPSGet]InstallPoshNet]
VERBOSE: [HILLR1-VM-VS14B]: LCM: [ Start Test ] [[cPSGet]InstallPoshNet]
VERBOSE: [HILLR1-VM-VS14B]: [[cPSGet]InstallPoshNet] Module PoshNet is absent from the
system and ensure is set to Present
VERBOSE: [HILLR1-VM-VS14B]: LCM: [ End Test ] [[cPSGet]InstallPoshNet] in 0.0646 seconds.
VERBOSE: [HILLR1-VM-VS14B]: LCM: [ Start Set ] [[cPSGet]InstallPoshNet]
VERBOSE: [HILLR1-VM-VS14B]: [[cPSGet]InstallPoshNet] adding module PoshNet
Module 'PoshNet' was not found in the Gallery.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ModuleNotFound,Find-PSGetExtModule
+ PSComputerName : localhost

VERBOSE: [HILLR1-VM-VS14B]: LCM: [ End Set ] [[cPSGet]InstallPoshNet] in 0.7494 seconds.
The PowerShell DSC resource PSHOrg_cPSGet threw one or more non-terminating errors while running the
Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational.
Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.703 seconds

This is my source file:

Configuration TestConfig
{
param ($MachineName)

Import-DscResource -ModuleName cPSGet

Node $MachineName 
{ 
    cPSGet InstallPoshNet
    {
        Name   = "PoshNet"
        Ensure = "Present"
    }
} 

}

TestConfig -MachineName localhost

I can install this module interactive in the PowerShell prompt using "Install-Module PoshNet".

Giving back with resources (4 total, 2 modules)

I've got a small handful of resources I'd like to "give back to the community". my understanding is the best way to do this is to ask for a resource to be opened up for me :).

Resource 1: Prosum_cClusterNetworking ... new resource for existing cFailoverCluster.

Use: Allows you to specify the IP/prefix of a cluster network and then configure the Name, Metric, and "Role" (Public, Private, Mixed").

Module 1: cSCCM: contains resources specific to SCCM
Resource 1: Prosum_cCMCollection
Resource2: Prosum_cCMCollectionRule
Resource3: Prosum_cCMFolder

These three resources begin my attempt to make SCCM easier to configure by using DSC to "hydrate" initial folders and collections. Consultants like me may appreciate having all collections in DSC format.

Add-DSCEncryptedPassword Fails with Convert Error

I'm attempting to add some DSC Encrypted Passwords using the Add-DscEncryptedPassword function. Running the following command results in an error.

Add-DscEncryptedPassword -StoreName "MY" -Path .\Credentials -UserName "name" -Password "somepassword" -Verbose

VERBOSE: Adding credentials for name. (1 total.)
VERBOSE: Persisting credentials for name to disk.
VERBOSE: Encrypting credentials.
VERBOSE: Loading certificate from cert:\LocalMachine\My\
ConvertTo-EncryptedFile : Cannot convert the "System.Security.Cryptography.X509Certificates.X509Store" value of type "System.Security.Cryptography.X509Certificates.X509Store" to type
"System.Security.Cryptography.X509Certificates.X509Certificate2".
At C:\SD\FM6\Tools\Scripts\powershell\dsc\DSC_Tooling\DscConfiguration\Add-EncryptedPassword.ps1:49 char:5
+     ConvertTo-EncryptedFile -Path $FilePath -CertificatePath $LocalCertificatePa ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [ConvertTo-EncryptedFile], RuntimeException
    + FullyQualifiedErrorId : ConvertToFinalInvalidCastException,ConvertTo-EncryptedFile

Now in the Add-DscEncryptedPassword function it uses the $LocalCertificatePath variable which I traced down in the DscConfiguration.psm1 module. Now this points to a thumbprint that is generated by this command

"$((Get-DscLocalConfigurationManager).CertificateId)"

Now I do not currently have a certificate installed, which is ultimately the source of the error. My question is such, can we write a better error to check for this before we get this far into the stream? Can we also make it clearer where this variable is coming from to allow better management of it?

Get-DscConfigurationData filtering behavior

I'm not sure if this was the intended behavior. but when filtering for a single name or nodename none of the site, service or credentials are loaded.

with out that data the returned configuration data is not a complete set that a single node would use.

Is there a reason behind this?

DscBuild: Restore state of Program Files directory on failed build

Right now, the first thing Invoke-DscBuild does is delete any modules in C:\Program Files\WindowsPowerShell\Modules if they have a different version than what's about to be tested and packaged.

If the tests then fail, those modules are now missing from the build server until the next successful build. This might cause problems if DSC is being used to manage the build server itself.

Two possibilities here:

  • See if we can test and package the modules (and compile configs) from a location other than the system-wide PSModulePath. Not sure if this is viable, due to the way Import-DscResource works, but it's worth investigating as a preferred option.
  • Instead of deleting the original module copies, just move them, and move them back if the build fails.

Publish these resources to the PSGallery

It would be way more convenient to install these resources if you published them to the PSGallery so I could install them all with:

Install-Module cPSHOrgResources

I'm thinking that you could put all of the resources into a single module - or not. I'm OK as long as I can get cPSGet easily even if it is with:

Install-Module cPSGet

:-)

UTF-16 Encoding causes garbage files on Windows

I've cloned your repo and even forked to my own and when I pull the files, I am unable to edit them or run them because they are filled with gibberish. They appear to be UTF-16 encoded, which I believe has been a problem for Git (doing diffs, etc.). Am I missing a setting or something to be able to use these?

Note that the files from Craig-Martin (except the .mof file) all open as expected.

Thanks!

Could not Infer CimType from the prodvided .NET Object

Kind of a weird one but I'm getting this strange error when running Get-TargetResouce from the WebAdminstration module.

When running the following code I get this error:

New-CimInstance : Could not infer CimType from the provided .NET object.
At line:4 char:33
+ $CimBindings += New-CimInstance -ClassName MSFT_xWebBindingInfor ...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo  : InvalidOperation: (Microsoft.Manag...InstanceCommand:NewCimInstanceCommand) [New-CimInst
   ance], ArgumentException
+ FullyQualifiedErrorId : New-CimInstance,Microsoft.Management.Infrastructure.CimCmdlets.NewCimInstanceCommand

CODE

$ensureResult = "Present"

[PSObject[]] $Bindings = (Get-ItemProperty -path IIS:\Sites\$Name -Name Bindings).collection | Where-Object {$_.Protocol -like "*http*" -and $_.Protocol -ne $null}

$CimBindings = @()

foreach ($binding in $bindings)
{
    $BindingObject = Get-WebBindingObject -BindingInfo $binding
    $CimBindings += New-CimInstance -ClassName MSFT_xWebBindingInformation `
        -Namespace root/microsoft/Windows/DesiredStateConfiguration `
        -Property @{
                Port                    = [System.UInt16] $BindingObject.Port;
                Protocol                = $BindingObject.Protocol;
                IPAddress               = $BindingObject.IPAddress;
                HostName                = $BindingObject.Hostname;
                CertificateThumbprint   = $BindingObject.CertificateThumbprint;
                CertificateStoreName    = $BindingObject.CertificateStoreName;
            } -ClientOnly
}

Now the strangest part is this only occurs if I am bound to an IP address on my server. Remove the IP and the code goes back to working.

Removed IP:

Port                  : 443
CertificateStoreName  : MY
CertificateThumbprint : <SSL Thumbprint Redacted>
IPAddress             : *
HostName              :
Protocol              : https
PSComputerName        :

Honestly I'm at a loss.

Modify New-DscResourceFromModule to accept new parameters

Currently the New-DscResourceFromModule hard codes the Author and Company Name to Steven Murawski and Stack Exchange. While I know Steven is a good guy I'm not sure he should get all the credit for the modules I'm creating. ๐Ÿ˜„

Could we add a couple of parameters to allow specification of the author and company?

cAppPool resource not executing

Just a simple config
configuration MyApp
{
Import-DscResource -modulename cWebAdministration
node localhost
{
cAppPool NewPool
{
Name = 'TestAppPool'
Ensure = 'Present'
}
}
}
MyApp

Results in this error...

PS C:\Users\a_jmarch> Start-DscConfiguration -Path .\MyWeb -wait -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' =
MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer JMARCH02 with user sid S-1-5-21-3595392803-2728658066-1154433773-43208.
VERBOSE: [JMARCH02]: LCM: [ Start Set ]
VERBOSE: [JMARCH02]: LCM: [ End Set ]
Failed to get exported command Get-TargetResource from module PSHOrg_cAppPool. Please check the module definition.
+ CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : GetTargetResourceCommandNotFound
+ PSComputerName : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.119 seconds

clustering functionality

Is there a more complete Clustering DSC Resource?

specifically what I either want to find, or build myself, or collaborate on with others is support for the following:

create/destroy cluster - looks like New Cluster is being handled
create/destroy/configure cluster node
create/destroy cluster groups
create/destroy/configure cluster resources of all resource types.

A while ago, I started to make a puppet provider to do this in my repo here. Initially I did them through ruby ole/win32 calls (in my master branch), which proved hard via some poorly documented cluster api stuff via ruby. Then I started to switch the calls away from ole calls to powershell. This seemed better, but I think if we are going to gain real traction for clustering using config mgmt tooling, and with the advent of @msutton work here and chef embracing DSC A fully featured cluster provider could be developed that ultimately will work across everything (chef,puppet,DSC)

I was wondering what peoples opinions are related to this and if they have real needs to address and want to weigh in. I haven't looked at DSC specifically but I also would not want to duplicate work that MS or others in the community may do or be doing already.

New Resources for ElasticSearch, NSSM, 7zip and JRE

Hi,

I've got a new set of resources for setting up Elastic Search and Kibana. Most of the resources written to get this done are also fairly broad, like NSSM, JRE and 7Zip so wondering if repo for general GripDevResources would be a good name?

DSCBuild: Allow resource modules to specify their own build scripts

Right now, we package up everything that's in source control, including Test files and any dependencies those have, into the module zip file for the pull server. In some cases, these test dependencies may contribute a lot to the size of the zip for no reason.

We could check for something like a Deploy.ps1 script in the module's root (which would accept a path parameter for the target directory) and let each module determine which of its files are necessary in the published zip file.

Possible cons, though: If a deployment script gets it wrong, then it could still pass tests but fail in production due to missing files.

cAppPool Test-TargetResource incorrectly reports password not matching

The line of code where the password value is tested currently uses the "-eq" operator and should be using the "-cne" operator (password are case sensitive which is why I added the "c". The code is:
<<<
$clearTextPassword = $Password.GetNetworkCredential().Password
if($clearTextPassword -eq $PoolConfig.add.processModel.password){
$UpdateNotRequired = $false
& $env:SystemRoot\system32\inetsrv\appcmd.exe set apppool $Name /processModel.password:$clearTextPassword
}

... and should be...
<<<
$clearTextPassword = $Password.GetNetworkCredential().Password
if($clearTextPassword -cne $PoolConfig.add.processModel.password){
$UpdateNotRequired = $false
& $env:SystemRoot\system32\inetsrv\appcmd.exe set apppool $Name /processModel.password:$clearTextPassword
}

Create a style guide

Looking through the code there appears to be a number of different formatting styles, aliases, and casing styles being used. This hurts my self-diagnosed OCD, could we please decide on a style guide so we can fix some of these things? Please?

Update credential encryption code

Spoke with Steve after working on the DscConfiguration module a bit earlier today. The current code is fairly limited in terms of what types of certificates it will support (no CNG providers), validating those certificates ahead of time, is not FIPS compliant, and involves leaving plain text passwords on disk temporarily during the decryption process.

Rather than implementing these security and funcitonality enhancements directly in the DscConfiguration module, we'll be updating the code to leverage an existing PowerShell crypto library instead. It should be possible to leave enough code in place to be able to decrypt any pre-existing files, but as soon as new passwords are added to a file, the new format will be in place.

building with Jenkins

attempting to build with Jenkins I get this error.

VERBOSE:
Get-DscResource : The term 'Get-DscResource' is not recognized as the name of
a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try
again.
At C:\Program Files
(x86)\WindowsPowerShell\Modules\dscbuild\Test-DscResourceIsValid.ps1:11 char:33

  •             $AllResources = Get-DscResource | Where-Object 
    
    {$_.ImplementedAs ...
  •                             ~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-DscResource:String) [], Com
      mandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Convert .docx docs to markdown

When downloading the repro I've found I've been unable to open the docx files (cNetworking, cWebAdministration) and am unable to recover them. Its been my experience that github doesn't handle this type of files well. Switching to md would allow github to parse the file in the browser, and allow us to make modifications to the documentation that are well documented surgical changes.

DSC Resource

Hi,

I would like to share my DSC Resource cFolderQuota .
Are you going to create the folder for me ?
I'm not sure how to upload it here

Regards

Mariusz

Open Source License

I've got some stuff I'd like to contribute, but I can't see a license anywhere. Could we get a license on the project (maybe MS-PL, same as the PowerShell Community Extensions)?

DSC Composite Resources

Due to the lovely answer from Robert Westerlund of this question http://stackoverflow.com/questions/22157256/powershell-dsc-composite-resources I now understand Composite Resource much better than from the official documentation.

I created a simple function along the lines of New-xDscResource, except it creates the proper folder structure and module files. I was wondering if this would be useful enough to be included here. I must admit contributing like this is new to me, so apologize if this isn't the proper way to ask. From what I've seen, I'm supposed to create a pull request but some projects prefer discussion first. Let me know what you decide.

Corrupted scripts in the DscConfiguration Foler

Hi everyone,

I was doing some testing this evening and noticed some corrupted scripts in the Tooliing\DSCconfiguration folder. An example is Get-ConfigurationData.ps1 opens up with chinese characters in the script. Viewing online within git looks great, but once I pull from the source; scripts in this folder get that awesome corruption on git. I love what you guy's are doing and please keep up the great work!

-Steve

image

How to get Credentials into a Configuration

I've been toying with this for a bit but I'm kind of confused on how I'm supposed to get credentials into my configuration using these tools.

My gut instinct is telling me to use Resolve-DscConfigurationProperty but I'm unclear on how to have the node referencing the credentials.

Something like
$script:ConfigurationData['Credentials']['Account'] strikes me as something that would work but again, not really sure.

Also is there a way to pass in passwords separately or do I have to pass in a credential object because MSFT_Credential is being used in the mof file?

Resolve-DscConfigurationProperty and Services vs node

When the same value exists in both a Service that a node is part of and the node itself the service setting is being returned when calling Resolve-DscConfigurationProperty. but when a setting is in AllNodes or a Node the value in AllNodes is returned.

Would it not make sense for the most spacific (IE the Node) value be returned?

Command conflicts

I just noticed that a number of commands in DscOperations conflict with commands in PSDesiredStateConfiguration (WMF4.0 with November roll-up)

Update-DscConfiguration
Test-DscConfiguration
Start-DscConfiguration

Resolve-DscConfigurationData function's auto-resolution feature has problems

If you don't specify a value for the -ConfigurationData parameter when calling Resolve-DscConfigurationProperty, it has code to try to find a variable named $ConfigurationData in a parent scope. Presumably, this logic is there because you would have access to a variable named $ConfigurationData inside the DSC configuration that's being executed.

The problem is that Get-Variable -Scope ## doesn't cross module boundaries, and DSC configurations are always being executed within the context of the PSDesiredStateConfiguration module. Unless a variable named $ConfigurationData exists within the Global scope, or in the scope of whatever module Resolve-DscConfigurationProperty is in (currently dscbuild), Resolve-DscConfigurationProperty won't find the variable using Get-Variable. For example:

configuration Config
{
    node $AllNodes.NodeName
    {
        WindowsFeature Thingy
        {
            Name = Resolve-DscConfigurationProperty -Node $Node -PropertyName FeatureName
            Ensure = 'Present'
        }
    }
}

# For this example, it doesn't even matter what's in the hashtable, just that it's
# named something other than $ConfigurationData out in the global scope.

$foo = @{
    AllNodes = @(
        @{
            NodeName = 'Bar'
            FeatureName = 'Web-Server'
        }
    )
}

$VerbosePreference = 'Continue'
Config -ConfigurationData $foo

<#
VERBOSE: 
VERBOSE: 
VERBOSE: Resolving ConfigurationData
VERBOSE:        Nothing in scope 1 for ConfigurationData
VERBOSE:        Nothing in scope 2 for ConfigurationData
VERBOSE:        Nothing in scope 3 for ConfigurationData
VERBOSE:        Nothing in scope 4 for ConfigurationData
VERBOSE:        Nothing in scope 5 for ConfigurationData

PSDesiredStateConfiguration\node : Failed to resolve ConfigurationData.  Please confirm that $ConfigurationData is property set in a scope above this Resolve-DscConfigurationProperty or 
passed to Resolve-DscConfigurationProperty via the ConfigurationData parameter.
At line:3 char:5
+     node $AllNodes.NodeName
+     ~~~~
    + CategoryInfo          : NotSpecified: (:) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RuntimeException,PSDesiredStateConfiguration\node

Errors occurred while processing configuration 'Config'.
At C:\windows\system32\windowspowershell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2088 char:5
+     throw $errorRecord
+     ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Config:String) [], InvalidOperationException
    + FullyQualifiedErrorId : FailToProcessConfiguration

#>

It might be better to make passing -ConfigurationData via the command line mandatory, though that would be a breaking change for existing configurations. Another option might be to make a single call to $PSCmdlet.GetVariableValue('ConfigurationData') , which would look up the variable in the caller's scope tree instead of within the dscbuild module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.