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. Compiling large number of DSC MOF files is slow

    We use logic to dynamically compose a ConfigurationData structure and pass it to the configuration. This logic executes quickly. Calling the configuration generates more than 5,000 MOF files for unique nodes. The process takes 1.5 hours on modern server-class hardware with 16GB RAM. Also, the MOF files are all created at the end of the process, rather than one-at-a-time throughout the process. This causes high memory usage. Please optimize the PSDesiredStateConfiguration module to generate large quantities of MOF files more quickly. This issue adds significant delay to the DSC pipeline.

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

    We’ll send you updates on this idea

    8 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  2. DSC registry resource support '/' in the registry path.

    DSC registry resource support '/' in the registry path.

    If you use a path containing a / e.g. "HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2 40/128" then the builtin registry resource you end up with an error or the wrong registry path being created.

    This config will not work. I've have to create my own module to create the folder and then us the registry resource to create the actual key.

        Registry "DisableCipherRC240128"
    
    {
    Key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2 40/128"
    ValueName = "Enabled"
    ValueType = "Dword"
    ValueData = "0"
    Ensure = "Present"
    Force = $true
    }

    The register resource should support / in the path.

    5 votes
    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. 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 →
  4. 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 →
  5. ConfigurationAST should include resource modules being imported

    The ConfigurationAST added in v4 for PowerShell DSC does a good job at providing resource configuration details. However, to determine what modules are being imported, we should still use the keyword AST to find the resource module names from the Import-DSCResource command. While this is a workaround, it will be easier if ConfigurationAST can provide this information for simplicity.

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  6. Use URI for DSC File Resource Source

    Ability to use a URI or URL as the source using the DSC File Resource to download from HTTP or HTTPS.

    8 votes
    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 →
  7. Allow DSC Reports to include ResourcesNotInDesiredState that were corrected during a consistency check

    Currently if a node is set up to ApplyAndAutoCorrect, when the report is sent back to the report server, there is no reference to any resources that were out of desired state at the time of the consistency check. DSC will just put them back in desired state without reporting what it did. For compliance reasons, we would like to be able to query the report server to see if any resources had to be put back into desired state.

    24 votes
    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. 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 →
  9. Determine who is calling TestScript

    The TestScript code in a Powershell DSC Script resource is executed by calling Test-DscConfiguration and by calling Start-DscConfiguration. I would like to determine which cmdlet called TestScript in the TestScript code.

    Suggested solution: property in $MyInvocation object

    Use case: write an event to the eventlog "Starting DSC config" only when Start-DscConfiguration is ran.

    Example code:
    Script MyScript
    {
    TestScript = {

    if ($MyInvocation.<property> -eq 'Test-DscConfiguration') {
    
    Write-Verbose "Called by Test-DscConfiguration"
    $true #do not run SetScript
    }
    else {
    Write-Verbose "Called by Start-DscConfiguration"
    $false #run SetScript
    }

    }
    SetScript = { Write-EventLog -LogName "Application" -Source "MyCompany" -EventID 1 -EntryType Information -Message…

    2 votes
    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 →
  10. Ability to run a DSC configuration item last

    Add the ability to run a particular item in a DSC configuration last.

    One could achieve this by chaining all items together with a DependsOn for each task, but that is less than ideal.

    This would be particularly handy for reboots, which you often want to be the last thing to run.

    2 votes
    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. Node with large configurations fails to send status report to the Report Server

    Testing out WMF 5.0 and when I tried one of our existing configurations, which has a good amount of resources in it, the following error is logged in the event log after each consistency check:

    Job {%JobID%} :
    Http Client {%AgentID%} failed for WebReportManager for configuration The attempt to send status report to the server https://johntestx02/PSDSCPullServer.svc/Nodes(AgentId={%AgentID%}')/SendReport returned unexpected response code RequestEntityTooLarge..

    I assume this is because of the amount of resources the node is trying to report on back to the report server. Has anyone else run into this? Can the Report Server configuration be adjusted to accept lager amounts…

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

    We’ll send you updates on this idea

    survey  ·  3 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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 →
  13. DSC Class resource fails intermittently when debug_mode != None

    As per https://powershell.org/forums/topic/class-based-dsc-resource-intermittently-fails/#post-47427

    When LCM's debug_mode is set to anything else than None, a config with a custom Class resource fails randomly with the following output:

    VERBOSE: [WIN-8SU88BLP5RK]: LCM: [ Start Resource ] [[EnvRefresh]TESTVAR]
    VERBOSE: [WIN-8SU88BLP5RK]: LCM: [ Start Test ] [[Env
    Refresh]TESTVAR]
    VERBOSE: [WIN-8SU88BLP5RK]: [[EnvRefresh]TESTVAR] Importing the module
    Env
    Refresh in force mode.
    Object reference not set to an instance of an object.

    + CategoryInfo          : OperationStopped: (:) [], CimException
    
    + FullyQualifiedErrorId : System.NullReferenceException
    + PSComputerName : localhost

    VERBOSE: [WIN-8SU88BLP5RK]: LCM: [ End Test ] [[EnvRefresh]TESTVAR] in 0.0780 seconds.
    The PowerShell DSC resource '[Env
    Refresh]TESTVAR' with…

    3 votes
    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 →
  14. Bug? Invoke-DscResource and PsDscRunAsCredential in WMF5

    Hi Powershell Team,

    When I try to invoke the get method for a custom DSC resource using PsDscRunAsCredential, I get an error. This does not happen with either the set or test methods.

    The same custom resource works fine in a normal configuration though. I'm not sure if that's because the get method is not called there.

    Setup:
    Windows Server 2012 R2
    WMF5 RTM

    PS C:\Users\username> Invoke-DscResource -Name cWhoAmI -Method get -ModuleName cWhoAmI -Property $props -Verbose
    Invoke-DscResource : The PowerShell DSC resource returned results in a format that is not valid. The results from
    running Get-TargetResource should be in a…

    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 →
    investigating  ·  Mark Gray responded

    Thanks for the feedback Antonio! We will look into this and create a bug when we reproduce the issue. If we need more information we will request it from you here.

    Regards,

    MarkG

  15. Add DSC Pull Server with Private PowerShell Gallery as a deployment option

    With PowerShell gallery coming to on-prem deployments, it will be a source of PowerShell DSC and other modules for all enterprise IT needs. PowerShell gallery uses SQL backend as a module store. There has been an ask to move the existing Pull Server database to SQL. By integrating Pull Server as a deployment option within PowerShell Gallery, the existing SQL store can be used as module and configuration store and eliminates the need for making a copy of all modules on a separate pull server. This also brings in the advantages / well-known deployment models of a typical web application…

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

    We’ll send you updates on this idea

    3 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  16. Invoke-DscResource String to Boolean conversion Failure

    Invoking command:

    Invoke-DscResource -Name cDtc -Method Test -Property @{'Name'='Local';'Ensure'='Present';'AuthenticationLevel'='NoAuth';'Status'='Started';'InboundTransactionsEnabled'='True';'OutboundTransactionsEnabled'='True';'RemoteClientAccessEnabled'='True';'RemoteAdministrationAccessEnabled'='False';'XATransactionsEnabled'='True';'LUTransactionsEnabled'='False'} -ModuleName cDtcResource

    Cause PowerShell to fail.

    Convert property 'OutboundTransactionsEnabled' value from type 'STRING' to type 'BOOLEAN' failed
    At line:17, char:2
    Buffer:
    essEnabled = "False";
    };^

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  17. Allow variable input to be passed to import-dscresource

    To keep configurations and composite resources as modular as possible, we should be able to pass an array of module specifications as a parameter.

    Consider the following:

    [Parameter()]

        [System.Collections.Hashtable[]]
    
    $DscResourcesToImport = @(
    @{ModuleName='xPSDesiredStateConfiguration'; ModuleVersion='3.9.0.0'},
    @{ModuleName='xComputerManagement'; ModuleVersion='1.4.0.0'}
    )
    )

    foreach ($Resource in $DscResourcesToImport)
    {
    $ModuleSpec = @{ModuleName="$Resource.ModuleName"; ModuleVersion="$Resource.ModuleVersion"}
    Import-DscResource -ModuleName $ModuleSpec
    }

    This fails with the error: "Arguments must be constant"

    Thanks for considering this.

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  18. Bug: DSC ServiceResource cannot start service that takes over 2 seconds to start

    Services can take an arbitrary amount of time to start. The ServiceResource DSC is hard coded to only allow 2 seconds. This makes this task useless for most of my work.

    function StartService
    <SNIP>

    if($PSCmdlet.ShouldProcess($svc.Name,$LocalizedData.StartServiceWhatIf))

    {
    
    try
    {
    $svc.Start()
    $twoSeconds = New-Object timespan 20000000
    $svc.WaitForStatus(&quot;Running&quot;,$twoSeconds)
    }
    catch
    {
    $servicePath = (Get-WmiObject -Class win32_service | where {$_.Name -eq $svc.Name}).PathName
    $message = $LocalizedData.ErrorStartingService -f $svc.Name,$servicePath,$_.Exception.Message
    ThrowInvalidArgumentError &quot;ErrorStartingService&quot; $message
    }

    Write-Log ($LocalizedData.ServiceStarted -f $svc.Name)
    }

    9 votes
    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 →
  19. Multiple configuration slots

    I would welcome the possibility for multiple configuration slots on a single node. This would enable scenarios like:
    Desired state for the Node itself in slot 1
    Proxy state in slot 2
    One-time configurations in slot 3

    This would make it possible to separate the state and governance of the node configuration from, for example, a one-time user account create in AD.
    Slot 1 would contain Domain Controller configuration in ApplyAndAutoCorrect mode and slot 2 would execute the creation of a new user and once converged, removes it.

    Same goes for my laptop. 1 slot for node configuration and 1…

    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. DSC StatusRetentionTimeInDays is not deleting files

    WMF 5 RTM

    StatusRetentionTimeInDays is not deleting files in C:\Windows\System32\Configuration\ConfigurationStatus as per http://powershell.org/forums/topic/cwindowssystem32configurationconfigurationstatus-directory-growing/#post-40747

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

    We’ll send you updates on this idea

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

Feedback and Knowledge Base