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. 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 →
  2. Allow whitespace between final newline and quotation mark in here-string

    Votes from Connect: 10

    Original Date Submitted: 12/10/2011 12:21:15 AM

    Description:
    Contact Information
    Handle: JoshGav
    Site Name: PowerShell
    Feedback ID: 712796


    Frequency: Always Happens
    Regression: Yes, this happens in previous released versions

    Problem Description:
    The final delimiter in a here-string is defined as newline-quotemarks-atsign. This means that the "@ has to be at the beginning of the final line, with no whitespace preceding it. This ruins attempts at tab indentation in scripts and functions. Whitespace should be allowed as part of the ending pattern between the newline and quotemarks so that tab indentation can be cleanly utilized.

    Product Studio item…

    18 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 →
  3. PowerShell 5 - bug in GetType() for COM objects IADSUser

    Votes from Connect: 9

    Original Date Submitted: 6/16/2015 3:12:31 AM

    Description:
    Contact Information
    Handle: Ondrej Sevecek
    Site Name: PowerShell
    Feedback ID: 1437366


    Frequency: PowerShell
    Regression: run the mentioned script on Windows 10.0.10074 in its built-in PowerShell 5.

    Problem Description:
    When I run the following on Windows 10.0.10074 in PowerShell 5, it does not work for user members of the local group:

    $admins = [ADSI] 'WinNT://./Administrators,group'

    foreach ($oneMember in $admins.Members()) {

    $oneMemberName = $oneMember.GetType().InvokeMember('Name', 'GetProperty', $null, $oneMember, $null)
    Write-Host $oneMemberName

    }

    The error is: Error while invoking GetType. Could not find member.

    While the code works fine on any other OS…

    16 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 →
  4. Splatting for class method input parameters

    Votes from Connect: 23

    Original Date Submitted: 5/28/2015 11:09:44 PM

    Description:
    Contact Information
    Handle: Trevor Sullivan [MVP]
    Site Name: PowerShell
    Feedback ID: 1376904


    Problem Description:
    In the spirit of splatting, a cool feature to have for PowerShell v5 or vNext, would be to be ale to splat method parameters on PowerShell classes.

    Right now, an error message appears: "The splatting operator '@' cannot be used to reference variables in an expression. '@NewPerson' can be used only as an argument to a command. To reference variables in an expression use '$NewPerson'."

    class Person {

    [string] $FirstName;
    
    [string] $LastName;

    Person ([string] $First,…

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

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  5. Invoke-Command -Scriptblock may incorrectly pass arrays as argument

    Dear Powershell team,

    I am running Powershell V 4.0 and recently I have come across an issue as arrays as passed as parameters to -Scriptblock.

    It is easily reproducible:

    Define array as array of strings

    [string []] $array1 = @()

    Load values into variable

    $array1 = "value1","value2","value3"

    Contents of variable

    $array1
    value1
    value2
    value3

    I pass my array as the argument to scriptblock

    However the array is broken on its members and considered as individual parameters

    args[0] should be an array of strings not a single string

    Invoke-Command -Scriptblock {$args[0]} -Args $array1 -ComputerName TestTarget
    value1

    If I invoke the whole

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

    We’ll send you updates on this idea

    3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  6. Add automatic PSModule and PSModuleRoot variables to all script modules

    Votes from Connect: 9

    Original Date Submitted: 8/26/2015 4:39:27 AM

    Description:
    Contact Information
    Handle: Kirk Munro
    Site Name: PowerShell
    Feedback ID: 1712772


    Problem Description:
    It is common to need to access the module info object or the module root folder from within a module. To facilitate this, two automatic variables should be defined within every module scope:

    $PSModule - set to $ExecutionContext.SessionState.Module
    $PSModuleRoot - set to $PSModule.ModuleBase

    With these defined, you have the root folder allowing you to reference the relative file structure of the module, and you can reference the module info to set the on close event handler,…

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

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  7. Insert space after tab completion

    It would almost always be appropriate to insert a space after a successful tab completion occurs. For instance, why must I press space after tab completion finishes Start-Service? I am most definitely going to type either a service name or a parameter name. And if I do auto-complete a parameter name, it would make sense to provide me with a space to type the parameter. The only exception to this would be for non-leaf file paths, where the user may still be typing the rest of the path.

    I used bash for the first time recently and really enjoyed the…

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

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  8. nCurses-like Library for PowerShell

    Votes from Connect: 10

    Original Date Submitted: 5/22/2015 10:16:03 PM

    Description:
    Contact Information
    Handle: Trevor Sullivan [MVP]
    Site Name: PowerShell
    Feedback ID: 1356647


    Problem Description:
    Please include a text-GUI library, similar to nCurses, with PowerShell on Nano Server. This would enable the building of applications, such as text-based text editors.

    The framework should include support for building text-based windows, and keyboard shortcuts.

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 1356647 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1356647).

    Repro Steps:

    Internal BugId: 14507

    10 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 →
  9. Can't use keywords as class member names

    Votes from Connect: 8

    Original Date Submitted: 8/25/2015 10:53:08 AM

    Description:
    Contact Information
    Handle: Joel 'Jaykul' Bennett
    Site Name: PowerShell
    Feedback ID: 1709557


    Frequency: PowerShell
    Regression: Try to use a keyword as a method:

    class Startup {

    [void] Configuration([OWin.AppBuilder]$app)
    
    {
    $app.UseNancy()
    }

    }

    class Test {

    [hashtable]$Options
    
    [void] Switch([string]$option)
    {
    $Options[$option] = !$Options[$option]
    }

    }

    class Test {

    [hashtable]$Options
    
    [bool] If([string]$option)
    {
    return [bool]$Options[$option]
    }

    }

    Problem Description:
    We currently can't define methods or properties with names that match PowerShell keywords. This is silly, since we CAN define functions with those names -- and because of how you can use…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  10. Add .pst1 file extentsion to better support Pester Tests

    Currently there is no way of telling whether a PowerShell Script (.ps1) is full of pester (or perhaps Gherkin) tests or if it is an actual script without adding .tests. in between the file name and the ps1 extension

    This would make it cleaner in visibility as currently you could have the following

    Install-MyModule.ps1
    MyModule.psd1
    MyModule.psm1
    MyModule.psm1-help.xml

    And then the tests files could be the following
    MyModule.Tests.ps1
    Import-MyModule.Tests.ps1

    To combat this I would propose that tests could be formed in a file with a pst1 extension

    6 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 →
  11. Unable to set ACL using Set-ACL when not admin on ACL protected folder

    Votes from Connect: 10

    Original Date Submitted: 6/4/2013 1:44:02 PM

    Description:
    Contact Information
    Handle: Michael V DK
    Site Name: PowerShell
    Feedback ID: 789418


    Frequency: Always Happens
    Regression: Yes, this happens in all previous versions

    Problem Description:
    Under a sudden condition PowerShell's Set-ACL fails when trying to set permissions on a folder on a NTFS volume.

    Error:
    Set-ACL : The process does not possess the 'SeSecurityPrivilege' privilege which is required for this operation.

    At line:48 char:1


    • Set-ACL -path $path -AclObject $ACL



    • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


      • CategoryInfo : PermissionDenied: (\server\share\subfolder1:String) [Set-Acl], PrivilegeNotHeldException


      • FullyQualifiedErrorId : System.Security.AccessControl.PrivilegeNotHeldException,Microsoft.PowerShell.Commands.SetAclCommand




    Conditions:

    1) Your are not admin on the file server …

    6 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 →
  12. PowerShell.exe returns a passing (0) exit code when a ParserError is thrown.

    Votes from Connect: 38

    Original Date Submitted: 6/25/2012 4:56:11 AM

    Description:
    Contact Information
    Handle: silent__thought
    Site Name: PowerShell
    Feedback ID: 750654


    Frequency: Always Happens
    Regression: I don't know if this issue existed previously

    Problem Description:
    PowerShell.exe still returns a passing (0) exit code when a ParserError is thrown.

    These Parser Error can be triggered by badly formatted arguments passed to the script, which means you can never guarantee that a script exiting with a 0 exit code actually passed.

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 750654 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=750654).

    Repro Steps:

    from the

    6 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 →
  13. Add Support for LINQ

    Votes from Connect: 61

    Original Date Submitted: 1/11/2011 12:54:36 PM

    Description:
    Contact Information
    Handle: Joel -Jaykul- Bennett
    Site Name: PowerShell
    Feedback ID: 635454


    Frequency: Always Happens
    Regression: Yes, this happens in all previous versions

    Problem Description:
    When LINQ is available, it can push queries into the native language of the underlying storage without requiring users to learn that query language. This transformation can speed up queries to perform hundreds times faster, and when the alternative is to ship large amounts of data over the wire to be filtered locally, thousands of times faster.

    In many cases using LINQ can convert…

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

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  14. Add an -async parameter to powershell.exe

    Votes from Connect: 13

    Original Date Submitted: 10/22/2015 8:22:53 PM

    Description:
    Contact Information
    Handle: Kirk Munro
    Site Name: PowerShell
    Feedback ID: 1929427


    Problem Description:
    When invoking PowerShell.exe from the command line, you don't always want to wait until the process finishes before you continue performing other tasks. For example, when invoking a powershell.exe task from an event (trigger) in SQL Server. Today this requires invoking powershell.exe to run Start-Process to invoke powershell.exe in an asynchronous manner. This double-invoke is annoying and should be unnecessary.

    I would like to see an additional parameter on PowerShell.exe, -async, that automatically handles the asynchronous…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. Start-Process doesn't work if in a directory name containing brackets

    Votes from Connect: 4

    Original Date Submitted: 6/19/2015 5:39:22 PM

    Description:
    Contact Information
    Handle: DaveJRoberts
    Site Name: PowerShell
    Feedback ID: 1449458


    Frequency: PowerShell
    Regression: Create directory "C:\TMP\y[12]\testdir"


    • Change to C:\TMP

    • Run "Start-Process y[12]" (see it launch an explorer window at 'y[12]')

    • Run "Start-Process explorer" (see it launch a general explorer window)


    • Change to C:\TMP\y[12]


    • Run "Start-Process testdir" (it fails saying "C:\tmp\y[12] did not resolve to a file")

    • Run "Start-Process explorer" (it fails saying "C:\tmp\y[12] did not resolve to a file")

    Problem Description:
    PowerShell v4.0, Microsoft Windows 7 Enterprise, 64-bit, Microsoft Windows NT 6.1.7601 Service Pack 1

    Running Start-Process from within…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  16. BREAK in nested Loops behaves weird

    I found a weird behavior of BREAK in nested loops.

    Here my test-code:

    1

    :OuterLoop ForEach ($x In 1..3) {
    'x' + $x
    :InnerLoop ForEach ($y In 1..8) {

      ' y' + $y
    
    If ($y -ge 5) {
    Break InnerLoop
    }

    }
    }

    2

    :OuterLoop ForEach ($x In 1..3) {
    'x' + $x
    :InnerLoop ForEach ($y In 1..8) {

      ' y' + $y
    
    If ($y -ge 5) {
    Break NoLoop
    }

    }
    }

    1 breaks the inner loop as expected.

    2 breaks the outer loop though I specified the not-existing label "NoLoop" for BREAK. I would expect an error or

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  17. PowerShell.exe -NonInteractive still prompts user with Out-GridView

    Votes from Connect: 4

    Original Date Submitted: 9/28/2015 2:16:15 AM

    Description:
    Contact Information
    Handle: Trevor Sullivan [MVP]
    Site Name: PowerShell
    Feedback ID: 1842431


    Frequency: PowerShell
    Regression: powershell.exe -NonInteractive -Command gps | ogv -PassThru

    Problem Description:
    PowerShell.exe -NonInteractive still prompts user with Out-GridView

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 1842431 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1842431).

    Repro Steps:
    powershell.exe -NonInteractive -Command gps | ogv -PassThru

    Expected Results:
    Out-GridView should throw similar exception to Read-Host:

    "read-host : Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available."

    Internal BugId: 15852

    3 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 →
  18. Errors that terminate script due to -ErrorAction Stop do not show correct line number

    PS > type .\error.ps1
    [Cmdletbinding()]
    param()

    "hello"
    "world"

    1/0
    

    PS > .\error.ps1
    hello
    world
    Attempted to divide by zero.
    At D:\junk\error.ps1:10 char:5
    + 1/0
    + ~~~

    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    
    + FullyQualifiedErrorId : RuntimeException

    PS > $ErrorActionPreference = "Stop"
    PS > .\error.ps1
    hello
    world
    D:\junk\error.ps1 : Attempted to divide by zero.
    At line:1 char:1
    + .\error.ps1
    + ~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [error.ps1], RuntimeException
    
    + FullyQualifiedErrorId : RuntimeException,error.ps1

    Note incorrect line number being reported on second invocation when ErrorActionPreference equals "Stop"

    This can also be reproduced by putting "$ErrorActionPreference = "Stop" at line 3 of the…

    3 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. Backport Powershell 6.x to Windows Powershell

    To keep Windows Powershell up to date please backport any new features from Powershell 6.x to Windows Powershell.

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

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  20. Receive-Job duplicates Write-Host output

    Starting in PowerShell 5.1, if a background job uses Write-Host, the Receive-Job cmdlet shows each line of output twice.

    Steps to Reproduce


    1. Run this command: Start-Job { 1..10 | % { Start-Sleep -Milliseconds 10 ; Write-Host $_ } } | Wait-Job | Receive-Job

    2. Note the duplicate numbers. This error does not happen in Powershell 6.0.4.

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

    We’ll send you updates on this idea

    2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base