PowerShell

The PowerShell forum accepts bug reports as well as feedback and suggestions. For more information, check out the PowerShell Homepage

The following is a list of the states we use to track items.

status meaning
survey We saw this and we are considering it. Please upvote if it’s important to you.
needs more information We don’t understand the issue and need additional details.
investigating We are looking at this internally to understand things like: scenario, reproduction of issue, costing, or other technical details.
in queue The issue is understood and in our unprioritized backlog. Your votes will be used to drive prioritization of this work.
  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Bug: DSC error when executing configuratin with Set-PSDebug -Strict - "$notAllowedValue cannot be retrieved because it has not been set"

    When you execute a configuration .ps1 script with Set-PSDebug -Strict turned on, you get the following error:

    PSDesiredStateConfiguration\Node : The variable '$notAllowedValue' cannot be retrieved because it has not been set.

    I can work around this by using the following code snippet:

    Set-PSDebug -Off
    $mofFile = SetPullMode -ComputerName $comp -OutputPath $mofFilePath -ConfigurationId $ConfigurationId -Thumbprint $cert.Thumbprint -PullserverUri $PullServerUri
    Set-PSDebug -Strict

    This sounds like a scoping issue in DSC somewhere with the notAllowedValue variable.

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    In Queue  ·  1 comment  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  2. Double DependsOn in mof when using foreach loops

    When using a foreach loop to create a set of resources and trying to set the previous item key as the dependsOn resource, it adds it twice in the mof file.

    Configuration example:
    configuration Test-DependsOnWithLoop {

    param([string[]]$Directories)
    
    Import-DscResource -ModuleName PSDesiredStateConfiguration
    node localhost {
    $dependsOn = $null
    $dirs.ForEach({
    $res = $_ -replace '\\|:', '_'
    File $res {
    Ensure = 'Present'
    DestinationPath = $_
    DependsOn = $dependsOn
    Type = 'Directory'
    }
    $dependsOn = "[File]$res"
    })
    }

    }

    $dirs = 1..10 | % { "C:\Temp_$_" }
    Test-DependsOnWithLoop -Directories $dirs

    And if you look at the localhost.mof you'll see:
    DependsOn = { "[File]CTemp

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    In Queue  ·  0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  3. BUG: GetMetaConfiguration should validate property values against allowed values of MSFT_DSCMetaConfiguration CIM Properties

    Once a node meta configuration is enacted, it is easy for an administrator or process (with malicious intent) to modify the MetaConfig.mof file in C:\Windows\System32\Configuration directory. The GetMetaConfiguration method in MSFT_DscMetaConfiguration class does not validate the property values against the allowed values of the CIM properties.

    Steps to reproduce this behavior:
    - Enact a simple meta configuration and enact it.
    - Open the MetaConfig.MOF file in your favorite editor and change the value of ConfigurationMode to some random text.
    - Save the file and close it.
    - Run Get-DscLocalConfigurationManager.
    - You will see the random value assigned to ConfigurationMode in…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
    In Queue  ·  Mark Gray responded

    Ravikanth,

    We have validated this issue and created two bugs for it.

    1. We will validate the MOF when it is passed in as part of our API (i.e. Set-DscLocalConfigurationManager) and error if the values are not valid.
    2. We will write a warning when Get-DscLocalConfigurationManager reads a MOF that has invalid values and at LCM startup. The resultant behavior will behave like it does today where invalid values will be read as the default value by the LCM.

    Please let us know if this meets your expectations.

    Regards,

    MarkG

  4. Bug: [nullable[enum]] DSC Property throws System.NotSupportedException in WMF5 RTM

    In WMF5 Production Preview the [nullable] flag was required to allow a DSC Property to be null valued. Without this flag a default value was being added to the mof file.

    In WMF5 RTM (Windows 10 installation) the [nullable] flag causes a System.NotSupportedException error to be thrown when running a configuration block.

    In WMF5 RTM, if the [nullable] flag is not used, null values are allowed. I believe this is the same functionality as WMF4.

    The [nullable] flag is shown in the MSDN documentation for DSC. https://msdn.microsoft.com/en-us/powershell/dsc/authoringresourceclass

    This should be fixed/clarified to the community.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base