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. Error when changing/reconfiguring a Service Resource

    I was trying to use a DSC Configuration to automate the release of a Windows Service application. However, I ran into the following issue that could be problematic.

    After applying the following configuration...

        Service "Hello" {
    
    Name = "Hello"
    Path = "C:\hello\hello.exe"
    State = "Stopped"
    Ensure = "Present"
    }

    I modify to and apply the following...

        Service "Hello" {
    
    Name = "Hello"
    Path = "C:\WinServices\hello"
    State = "Stopped"
    StartupType = "Disabled"
    Ensure = "Present"
    }

    With the sole change being the addition of StartupType = "Disabled".

    The problem is that applying the modification yields the following error...

    PowerShell DSC resource…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  2. issue with encrypted mofs on a pull server [partialconfigs]

    i have a pull server with 2 non-encrypted mofs, and 1 encrypted mof. The LCM on the lab node is configured to pull the 3 different configs as partialconfigs. When I run Start-DSCConfiguration, the encrypted mof fails with the following:

    PowerShell DSC resource MSFT_UserResource failed to execute Set-TargetResource functionality with error message: There could be a possible multiple matches exception while trying to use the System.DirectoryServices API's.Exception calling "Save" with "0" argument(s): "The
    password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.
    "

    + CategoryInfo          : InvalidOperation: (:) [], CimException
    
    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  3. Automatic Conflict Resolution For Partial Configurations

    The LCM is already able to detect conflicts, with a fairly small change you could make it automatically resolve it.
    In my opinion we should be able to set a priority of each partial configuration in the meta config of the LCM.
    With a priority set and when a conflict is detected, the LCM could look at the priority and choose a winner.

    You could than create a layered approach of partial configs (by different teams) without having to be afraid of running into conflicts.

    This is something I see more people struggling with, which results in solutions like datum…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  4. Import-DSCResource for File, others fails

    When using Import-DSCResource -Name, various OOB resources do not work. Consider 'File' which is a built in resource, the following code will fail.

    Configuration Sample
    {

    Import-DSCResource -Name File
    
    

    # This will generate two .mof files, a localhost.mof, and a server02.mof
    Node @('localhost', 'server02')
    {
    File SampleFile
    {
    DestinationPath = 'C:\Temp\temp.txt'
    Contents = 'This is a simple resource to show Configuration functionality on a Node.'
    }
    }

    }

    Sample -OutputPath P:\temp\

    Start-DSCConfiguration P:\temp -computername localhost -wait -verbose

    If you change the resource to Service, it works as expected.

    I'm guessing this is because File is a binary resource under System32\Configuration,…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  5. Find-DSCResource does not find resources.

    Find-DSCResource does not find resources. The wildcarded -Name parameter does not find anything when used, the Filter parameter seems to map Module names only, and even used seems to miss resources.

    To reproduce:

    Find-DSCResource -Name time - finds nothing
    Find-DSCResource -Filter time - does not find newer TimeZone resource (only xTimeZone)

    Find-DSCResource -Filter time does not find anything.

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  6. At line:4 char:1 + Import-DscResource -ModuleName cNtfsAccessControl + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Could not find the

    Can you provide solution for this error.
    I am getting it even after i downloaded NTFS security files.

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  7. MICROSOFT RAILWAY CORPORATION

    Now at this time called India,Pakistan & Bangladesh whose name was India.Yow know there are a lot of spaces for travelling.Indian Microsoft will be set up, a open independent Railway corp in the Whole India.Its will be a great way for our child,brother,sister,parents & all classes people.If Microsoft will be set up that way,many peoples will be satisfied for the way.& besides the way,many grounds are so many blank to a few year.There will be growing a lots of food & this foods will suppliers the Whole World.Otherwise,there are will be planning many trouthfull industries for our peoples worktivities.Trust,that IDEA…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  8. dsc Partial configuration - pull server

    0
    down vote
    favorite
    I have a big issue that I cant solve, need help!

    Im using partial configuration to configure 3 servers. The problem is mof file name. In Microsoft documentation (https://docs.microsoft.com/en-us/powershell/dsc/partialconfigs) says: "If you are pulling more than one partial configuration from a pull server, the configuration document can be named (...) ..mof, where ConfigurationName is the name of the partial configuration, and NodeName is the name of the target node."

    I'm trying ..mof and it returns the warning "WARNING: [DSC-3]: [] Executing Get-Action on partial configuration 'PreStagging' Failed. Please ensure the parital configuration and its…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  9. [Bug] DSC configuration allows multiple resource instances with duplicate key values

    Before PowerShell 5.1, compilation of DSC configurations having resource instances with duplicate keys resulted in a compilation error.

    However, with 5.1, this seems to have changed.

    Configuration FileDemo
    {

    Import-DscResource -ModuleName PSDesiredStateConfiguration -ModuleVersion 1.1

    Node Localhost
    {
    File TestFile1
    {
    DestinationPath = 'C:\Scripts\Test.txt'
    Contents = ''
    Type = 'File'
    }

    File TestFile2
    {
    DestinationPath = 'C:\Scripts\Test.txt'
    Contents = ''
    Type = 'File'
    }
    }

    }

    FileDemo

    This configuration will compile with no errors.

    PS C:> $PSVersionTable

    Name Value


    PSVersion 5.1.14393.1914

    PSEdition Desktop

    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}

    BuildVersion 10.0.14393.1914

    CLRVersion 4.0.30319.42000

    WSManStackVersion 3.0

    PSRemotingProtocolVersion 2.3

    SerializationVersion 1.1.0.1

    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 →
  10. DSC Archive Resource (unzip) holds zip-file

    This is more a indirect failure experience. Please bear with me if this is the wrong place: Expanding a zip-file with DSC in an Archive Resource leaves a process holding the zip-file. This gives that the zip-file can not be deleted by the same script or in the same PowerShell session.
    The error message from Remove-Item on the zip-file is like this: "Remove-Item : Cannot remove item C:\temp\jjdk1.8.0112-CE.zip: The process cannot access the file 'jdk1.8.0112-CE.zip' because it is being used by another process.".
    In issue 240 to Plaster on GitHub (https://github.com/PowerShell/Plaster/issues/240) it is mentioned by Keith…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  11. Disable SSL CRL check on Linux boxes

    I tried to follow "How to Script Disabling CRL Checking With Netsh and Powershell" guide: (https://blogs.msdn.microsoft.com/timomta/2013/06/24/how-to-script-disabling-crl-checking-with-netsh-and-powershell/)
    However netsh is not available on Powershell 6.0.0-alpha Linux version. Could you provide me an alternative?

    Regards,

    ~~~
    PS /root> $PSVersionTable

    Name Value


    PSVersion 6.0.0-alpha

    PSEdition Core

    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}

    BuildVersion 3.0.0.0

    GitCommitId v6.0.0-alpha.14

    CLRVersion

    WSManStackVersion 3.0

    PSRemotingProtocolVersion 2.3

    SerializationVersion 1.1.0.1

    PS /root> netsh netsh : The term 'netsh' 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…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  12. Composite DSC Resources DependOn Bug?

    Composite Resources DependsOn Bug?

    Bumped into this URL and it seems I'm experiencing the same issue with composite resources DependsOn:

    https://powershell.org/forums/topic/composite-resource-dependson-bug/

    > $psversiontable

    Name Value


    PSVersion 5.1.15063.502
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.15063.502
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1

    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 →
  13. Bug comparing identical DSC resources with complex properties

    I have system modules that are deployed in nodes according to the configuration data file (psd1). For example, one node can have three modules, or there may be three nodes each one with a module.
    All modules have a common configuration, so I put this configuration in a separate composite resource. Then, if there are more than one module in a node, the resulting configuration will have duplicate resources.
    The problem occur when one of these duplicate resources have some complex property. Here is a simplified version of my configuration:

    Configuration BaseWebConfiguration
    {

    Import-DscResource -ModuleName xWebAdministration
    
    

    xWebsite DefaultSite
    {
    Ensure…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  14. 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

  15. Type restrictions when rendering a property as a string in a MOF-file

    Dear,

    As we use Powershell V5 Classes extensively, we create instances of a class and add them to a Hashtable.

    This hashtable is assigned to an member of a DSC Resource. When creating the .MOF file, I receive an System.ArgumentException on the DSC resource "PSDesiredStateConfiguration.psm1"

    -> Only certain basic-types are allowed to be serialized to MOF-file :

            $elementsAsStrings = foreach ($p in $Value.GetEnumerator())
    
    {
    if($p.Value -isnot [string] -and
    $p.Value -isnot [char] -and
    $p.Value -isnot [int64] -and
    $p.Value -isnot [uint64] -and
    $p.Value -isnot [double] -and
    $p.Value -isnot [bool] -and
    $p.Value -isnot [datetime] -and
    $p.Value -isnot [ScriptBlock])
    {
    $errorMessage = $LocalizedData.HashtableElementTypeNotAllowed -f
    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  16. partial

    Hi all,
    I am using DSC partials to create role-based architectures with Azure virtual machines.
    When switching to Windows 2016 (everything works great on Windows 2012 R2), I get errors when DSC is compiling the MOF.
    The idea is that I have multiple partials that contain the same Windows Feature installation, because it's needed for a certain roles. When I apply more roles on the same machine, the partials need to merge. So I have one partial that contains this:

        WindowsFeature DotNetFrameworkRole1
    
    {
    Name = 'AS-NET-Framework'
    }

    and another partial that contains this:

        WindowsFeature DotNetFrameworkRole2
    
    {
    Name = 'AS-NET-Framework'
    }
    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    investigating  ·  1 comment  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  17. There is no step by step documenation in place how to install SQL server using xsqlps module

    There is no step by step documenation in place how to install SQL server using xsqlps module

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  18. DSC should have an isolated mode which allows multiple concurrent configurations and Node localhost without altering the LCM

    Here's the situation: We are an ISV and want to run some automated tests for our product, and we want them to run in an environment that we can just throw away and rebuild. We've got a bunch of Fitnesse tests, but we want an automated way to install the product and run the tests from a build definition. We want to be able to do several of these at once, with different builds pointing to different environments.

    DSC has some awesome capabilities but there are some ways it falls down in this regard. The most critical of these is…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  19. Invalid MOF generated if File resource used with contents that contain ModuleVersion=*** string

    A simple DSC File resource usage:

    Configuration CopyCustomResourceProviders {

    Import-DSCResource -ModuleName @{ModuleName="PSDesiredStateConfiguration"; ModuleVersion="1.1"}
    
    

    Node $nodeName {
    File test {
    DestinationPath = "$pshome\Modules\empty"
    Contents="ModuleVersion='1.2'"
    }
    }

    }
    This generates invalid MOF content:

    instance of MSFTFileDirectoryConfiguration as $MSFTFileDirectoryConfiguration1ref
    {

    ResourceID = "[File]test";
    
    Contents = "ModuleVersion='1.2'";
    DestinationPath = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Modules\\empty";
    ModuleName = "PSDesiredStateConfiguration";
    SourceInfo = "C:\\Source\\CoreDev\\Trunk\\Provisioning\\CopyCustomResourceProviders.ps1::34::4::File";

    ConfigurationName = "CopyCustomResourceProviders";

    };

    And the following error occurs on the command line when trying to push this configuration:

    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 WSDING037 with user sid…

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

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  20. Bug when running GET-DSCConfiguration on windows10 build 1511

    I'm getting an error while running get-dscconfiguration in client pull mode with very simple configuration (one WindowsOptionalFeature resource)

    PS C:\windows\system32\Configuration> Get-DscConfigurationStatus

    Status StartDate Type Mode RebootRequested NumberOfResources


    Success 03.08.2016 08:34:43 Consistency Pull False 1

    PS C:\windows\system32\Configuration> Get-DscConfiguration
    Get-DscConfiguration : GetConfiguration did not succeed.
    At line:1 char:1
    + Get-DscConfiguration
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get
    -DscConfiguration], CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration

    Related event:
    Job {4F79900F-5941-11E6-BBD9-D8CB8A17BF71} :
    Message Nie można rzutować obiektu typu (cannot cast) 'System.Management.Automation.PSObject' na typ 'System.Object[]'.
    HResult -2147467262
    StackTrack w System.Management.Automation.LanguagePrimitives.ConvertToT
    w Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.GetPSObjectArrayValue(CimType cimType, Object propertyValue)
    w Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.GetTargetResource(IntPtr resourceConfigurationInstanceHandle, IntPtr nonResourcePropetiesHandle, IntPtr metaConfigHandle, IntPtr…

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

    We’ll send you updates on this idea

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

Feedback and Knowledge Base