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. 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…

    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 →
  2. 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]…

    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 →
  3. 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 →
  4. 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…

    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 →
  5. 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 →
  6. 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 →
  7. 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…

    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 →
  8. 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 →
  9. 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:
    #…

    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 →
  10. 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…

    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 →
  11. 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…

    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 →
  12. 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…

    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 →
  13. 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 →
  14. 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 →
  15. 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 →
  16. 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 →
  17. 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 →
  18. Bug: Invoke-WebRequest keeps downloading beyond the file's size

    Migrated from here: https://github.com/PowerShell/PowerShell/issues/7822.

    To repro:

    powershell wget https://storage.googleapis.com/chrome-infra/depot_tools.zip

    The file size is ~19MB, but the download progress goes way beyond that and has to be manually stopped.

    At the same time, (New-Object System.Net.WebClient).DownloadFile() works correctly.

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. Bug: Powershell doesn't deal with returning empty arrays from functions to methods

    Given this module:
    class TestClass {
    [object]ReturnEmptyArray() {
    $testobject = Get-EmptyArray
    if($testobject -eq $null){
    Write-Host "Is Null"
    }
    return $testObject
    }

    [object]ReturnNull() {
    $testobject = Get-Null
    if($testobject -eq $null){
    Write-Host "Is Null"
    }
    return $testObject
    }
    }

    function Get-EmptyArray {
    return @()
    }

    function Get-Null {
    return $null
    }

    function Get-TestClass {
    return [TestClass]::new()
    }

    Export-ModuleMember Get-BlackDuckProject, Invoke-BlackDuckUrl, Get-TestClass

    the following works as expected:
    $test = Get-TestClass
    $test.ReturnNull()
    (a $null is returned)

    However, the following throws an exception:
    $test.ReturnEmptyArray()
    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  20. Bug: wrongly displayed elements in an array with different types

    This issue is easy to reproduce, just simplely put 2 objects of different types in an array variable, output the variable, and then change the 2 elements' order in the array, output the array variable again, you'll see the difference:
    > only the 1st element will be displayed in its correct format; the subsequent elements are displayed in the full output format.

    More details please refer to the gitlab issue:
    https://github.com/PowerShell/PowerShell/issues/7839#issuecomment-424193334

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base