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] Group-Object with -AsHashTable and custom expressions

    There seems to be a bug in Group-Object when using the -AsHashTable switch and where any custom expression that returns a string is used. The hashtable is created, can be enumerated, but trying to get an entry from it using the indexer doesn't work. This seems to be the case exclusively when the expression returns a string.

    Consider the following:

    PS C:\Windows> $Items = Get-ChildItem | Group-Object -Property Extension -AsHashTable
    
    PS C:\Windows> $Items

    Name Value
    ---- -----
    .DMP {MEMORY.DMP}
    .bin {mib.bin}
    .xml {Enterprise.xml, Starter.xml}
    .NET {Microsoft.NET}
    .INI {HPMProp.INI, init.ini, msdfmap.ini, SMSCFG.INI...}
    .dat {bootstat.dat, ConnectionProfiles.dat}
    .dll {ISMIF32.dll, twain.dll, twain_32.dll}
    .exe {bfsvc.exe,…

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

    We’ll send you updates on this idea

    survey  ·  4 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  2. Job cmdlets fail with UTF-8 codepage

    Powershell jobs (eg, Start-Job, Wait-Job, Receive-Job) fail when Powershell's codepage is set to UTF8.

    Simple reproduction on Server 2012R2 w/ PS5:
    from cmd.exe, set the parent process codepage and start powershell with:

    chcp 65001
    powershell

    from the powershell that just started:
    $job = Start-Job -ScriptBlock { Write-Output yo }
    Receive-Job $job -Wait

    The Receive-Job call will fail with: "
    [localhost] The background process reported an error with the following message: Cannot process an element with node type "Text". Only Element and EndElement node types are supported. at
    System.Management.Automation.Remoting.OutOfProcessUtils.ProcesData(String data, DataProcessingDelegates callbacks).

    + CategoryInfo          : OpenError: (localhost:String) [], PSRemotingTransportException
    
    + FullyQualifiedErrorId
    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  4 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  3. PS 5.0 Bug: Transcript stops after restarting a remote computer using ‘Restart-Computer’ with '-Wait' parameter.

    PS 5.0 Bug: Transcript stops after restarting a remote computer using ‘Restart-Computer’ with '-Wait' parameter.

    Example script:
    Start-Transcript c:\test.log
    $computername = "Fred"
    $credential = (get-credential "domain\user")

    Restart the remote computer.

    Restart-Computer -ComputerName $computername -Credential $credential -protocol WsMan -WsmanAuthentication Default -force -wait -for powershell -erroraction stop
    Stop-Transcript

    My tests were performed in the following environment - the source computer is Windows 7 SP1 with PowerShell 5.0, the target is Windows 7 SP1 with PowerShell 4.0.

    Upon completion of the reboot, the transcription is stopped. This is recorded in the transcript log file as “Windows PowerShell transcript end”. This results in 'Stop-Transcript'…

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

    We’ll send you updates on this idea

    survey  ·  2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  4. new parameter -markdown for Format-Table

    Example:

    $Get-Process | select -First 5 | ft -au

    Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName


    716     47 32832 43396   587          1764 AdminManagerClient
    
    257 34 3432 9352 84 1128 AgentService
    495 78 15700 28528 154 3744 AppVClient
    244 35 60952 41796 692 0.56 5416 AppVStreamingUX
    591 18 17280 22992 108 1,751.98 4672 audiodg

    $Get-Process | select -First 5 | ft -markdown

    |Handles|NPM(K)|PM(K)|WS(K)|VM(M)| CPU(s)| Id|ProcessName |
    |-------|------|-----|-----|-----|--------|----|------------------|
    | 716| 47|32832|43396| 587| |1764|AdminManagerClient|
    | 257| 34| 3432| 9352| 84| |1128|AgentService |
    | 495| 78|15700|28528| 154| |3744|AppVClient |
    | 244| 35|60952|41796| 692| 0.56|5416|AppVStreamingUX |
    | 591| 18|17280|22992| 108|1,751.98|4672|audiodg |

    This could be…

    5 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  5. Bug: Powershell 5: Transcription doesn't anymore capture warnings and verbose output from invoke-command.

    This used to work with Powershell 4.

    Try following code (call 'Test-TranscriptWarningFromInvokeCommand') and inspect the transcription file - the warning and verbose output from the 'remote' machine (visible on the console) is not in there!
    function Test-TranscriptWarningFromInvokeCommand {

    Start-Transcript -LiteralPath:"C:\Users\Public\Documents\Transcript-$(Get-Date -Format:"yyyy'-'MM'-'dd HH'-'mm'-'ss").txt" -Force
    
    Write-Host "Local: This is a write-host!"
    Write-Warning "Local: This is a write-warning!"
    Write-Verbose "Local: This is a write-verbose!" -Verbose
    #Write-Error "Local: This is a write-error!"
    try {
    Invoke-Command -ComputerName:$Env:ComputerName `
    -ScriptBlock:{ Write-Host "Remote: This is a write-host!"
    Write-Warning "Remote: This is a write-warning!"
    Write-Verbose "Remote: This is a write-Verbose!" -Verbose
    #Write-Error "Remote: This is a write-error!"
    }
    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  6 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  6. Make ISE look like a Windows 10 app

    ISE currently has shiny toolbars, detailed colourful icons, and old-style non-high res (ie, 2 inches wide) launch bitmap that covers other apps while ISE launches.

    Modern Windows tools have less distracting bling. Powershell should be consistent with other MS apps like Visual Studio or Word, with a minimal UI so we can focus on the content in the terminal.

    5 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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  7. Have the Find window to remember the last search string

    Have the Find window to remember the last search string

    5 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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  8. Simply copying code from PowerShell Gallery - Copy to Clipboard button

    Currently to copy code from the PowerShell all text has to be manually selected using the mouse and then copied. In order to simplify this a button to either copy or select all the code on the current page would improve the user experience.

    5 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  ·  PowerShell Gallery  ·  Flag idea as inappropriate…  ·  Admin →
  9. Partial Configurations should support validating ExclusiveResource reservations during publish or pull

    In the current implementation for Partial Configurations, the ExclusiveResources in the configuration fragment can be used to reserve resource modules or resources to a specific fragment. However, this is not validated until runtime. So, if there are two fragments that are using same resource modules and one fragment has those resources exclusively locked, the configuration enact will fail during runtime.

    These exclusive resource reservation checks should be done either at the publish time (push) or before enacting the configuration after a pull is complete.

    5 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 →
  10. Cmdlet version compatibility

    We need to define with wich version of Powershel and which operating system cmdlets are compatible.

    Could we have this compatibility matrix for each cmdlet in the documentation and also in the help section of each cmdlet?

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

    We’ll send you updates on this idea

    0 comments  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  11. IntelliSense pane's width should be user-configurable

    Even better if it can be specified through $psISE.Options.

    4 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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  12. Register-ArgumentCompleter is not documented

    The cmdlet Register-ArgumentCompleter is not documented.

    4 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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  13. Workflow: activities in nested workflows invoked from ForEach -Parallel execute on wrong machines

    Consider a workflow which is given a list of servers. The workflow contains a ForEach -Parallel block, which invokes a nested workflow tor each server from the list (using -PSComputerName). In this scenario, activities from some of the nested workflow instances sometimes execute on different servers than they should.

    Repro:
    workflow Reproduce-ForEachParallelRemotingBugChild
    {

    Param ([string] $s)
    
    Write-Verbose "(s=$s) PSComputerName $PSComputerName"
    Write-Verbose "(s=$s) sleeping"
    Start-Sleep -Seconds 1
    Write-Verbose "(s=$s) getting item"
    $x = Get-Item -Path C:\
    Write-Verbose "(s=$s) $($x.Name) $($x.PSComputerName)"
    Write-Verbose "(s=$s) PSComputerName $PSComputerName" # this is OK (PSComputerName does not get corrupted)
    if ($x.PSComputerName -ne $s)
    {
    Write-Error "BUG! This
    4 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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  14. Code completion pollutes $Error

    PowerShell v5

    Start a clean session:
    PowerShell -NoProfile

    Type the following characters:
    [cmd=

    and press Tab. The code is not completed, this is fine.

    But the global error collection $Error contains an error:
    The specified wildcard character pattern is not valid: [cmd=*

    Code completion should avoid such noise errors. They distract and may make an
    illusion that some user code produces them. Time may be lost on finding the
    actual culprit.

    4 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. Add parameters to Select-String for matching all lines from (StartPattern) to (EndPattern)

    To get blocks of text from a file, e.g. config sections from an opening tag to a closing line. All log lines for a reboot, starting with "System Booting at" and ending with "Boot Finished".

    Example:

    Select-String -Beginning '^FastEthernet' -Ending '^!'

    Output: Multiple arrays of lines taken from a Cisco switch config, each array containing the lines for a FastEthernet interface configuration.

    Example:

    Select-String -Between '^User: .*'

    Output: Arrays of lines from one "User: name" line to the next, to isolate blocks of settings for each user. Probably including the first match and excluding the second match, in the same…

    4 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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  16. Please add a way to programmatically collapse 1 region (ONLY ONE!) in a PowerShell script.

    Please add a way to programmatically collapse 1 region (ONLY ONE!) in a PowerShell script. I'd like to deliver a script with a region of dependencies collapsed. I can use dot sourcing to save someone from viewing the script from having to scroll through the function dependencies but it would be nice to be able to deliver the script in 1 file.

    An example of my use case can be found here: http://stackoverflow.com/questions/37835140/collapse-or-toggle-1-region-in-the-powershell-ise?sfb=2

    4 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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  17. Properly handle multi-line commands when read from stdin (and stdin is not a tty)

    If Powershell is reading scripts from stdin, when executed using "Powershell -Command - ", then it exits as soon as it sees a multi-line statement. This can be solved by adding an extra newline, but this should not be necessary if stdin is not a tty, and definitely not if "-NonInteractive" is specified.
    Further details and investigation here: http://stackoverflow.com/questions/37417613

    4 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  18. Provide Intellisense/Template for Manifests

    When creating a Manifest (.psd1), it would be handy to have Intellisense or at least a Template available.

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

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. BUG: Cim instances are not compiled correctly into MOF

    I'm trying to create a function that returns the bindinginfo for a website. This is intended to reduce the complexity of my dsc resource file that will have 20/30 websites with similar bindinginfo based on the node name. Anyway, it seems like the dsc compiler doesn't support cim instances. Doing the same thing with credentials actually works, so I wonder why this is the case for binding infos.

    This is an example to reproduce the problem

    configuration DscTest
    {
    Import-DscResource -ModuleName xWebAdministration;

    Node localhost
    {

    xWebsite TestWebSite
    
    {
    Ensure = "Present"
    Name = "TestWebSite"
    PhysicalPath = "C:\inetpub\test"
    BindingInfo = (Get-TestBindingInformation
    4 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    5 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
    survey  ·  Zachary Alexander responded

    Can you take a look below and leave a comment to let me know if the workaround is sufficient for your purposes? If so, I will close this item. If not, I will keep it marked as survey.

  20. [Bug] Creating Local Users Fails Test-DSCConfiguration if the Users are Disabled

    I can successfully create a disabled local user account on a non-domain joined server which has a password policy enforced.

    If I try to create the disabled account with out a password, or one in violation of the policy, the configuration fails. This is expected.

    If I create a disabled local user account with a password that meets the requirements, the configuration applies. When I run Test-DSCConfiguration the test fails with:
    PowerShell DSC resource MSFT_UserResource failed to execute Test-TargetResource functionality with error message:
    There could be a possible connection error while trying to use the System.DirectoryServices API's.Exception calling
    "ValidateCredentials" with…

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

    Phil,

    Sounds like a valid bug. Thanks for bringing it to our attention. I have opened a bug in our internal system to track this to resolution.

    MarkG

  • Don't see your idea?

Feedback and Knowledge Base