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.

Please feel free to provide feedback or file bugs here.

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. "Using module" statement does not reload module after changes are made

    Problem Description
    ------------------
    If you are using the `using module` statement, it will load the module without any issues. However, if you make a change to the module and run the `using module` statement again without restarting your PowerShell session, it will not load the new modified module into memory, and instead will continue to use the old existing module that was loaded. This makes doing development with `using module` statements very tedious as you must continually reload your PowerShell session whenever you make changes to the module.

    Ideally we would just use `Import-Module -Name [module name] -Force` to avoid…

    14 votes
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)

      We’ll send you updates on this idea

      0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    • Private methods in powershell class's don't work

      For reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/class_newtype#methods

      Creating private methods following the documentation does not work. To reproduce follow the following steps:

      * Open Powershell or the ISE
      * Copy the code from microsoft documentation
      * if ISE: The interface will alarm indicating problems
      * Execute documented test code
      * Observe several errors complaining about code syntax and missing brackets.

      You can also repro by adding the private designation to any working method of an existing class and it will bomb.

      2 votes
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        Signed in as (Sign out)

        We’ll send you updates on this idea

        0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
      • ERROR: Select-Object with -First parameter populates -ErrorVariable even if there was no error

        If you run: 1..2 | select -ErrorVariable a
        then $a is empty - OK.

        If you run: 1..2 | select -First 2 -ErrorVariable a
        then in $a is "System error"

        1 vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          Signed in as (Sign out)

          We’ll send you updates on this idea

          0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
        • Add ExportTo-Markdown

          Hi

          Using Markdown is common nowadays in VCS tools like Git for readme files.

          Plus it's handy to get a tabular strcture for better visibility.

          Example use cases:
          - Get-Process output comparison at different dates and time
          - SQL query results in tabular form with column names as headers

          So it'd be someInput|ExportTo-MarkDown

          2 votes
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            Signed in as (Sign out)

            We’ll send you updates on this idea

            0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
          • 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 | …

            5 votes
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              Signed in as (Sign out)

              We’ll send you updates on this idea

              survey  ·  1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
            • 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…

              11 votes
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                Signed in as (Sign out)

                We’ll send you updates on this idea

                0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
              • 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
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                • 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
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                  • 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
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                    • 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
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                      • 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
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                        • 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
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                          • 1 vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                            • Allow trailing commas

                              Trailing commas in lists are incredibly useful in a large number of instances, and there are very few good reasons and no really strong reasons not to.

                              Not allowing trailing commas is inconvenient in many situations: it frequently turns a one-line commit into two, polluting history (all I did was remove a comma from that line); it can complicate (and often put bugs in) code-generation ("$str += $value + "," doesn't cut it)

                              1 vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                              • Issue with running commands on remote machine

                                Hi Team,

                                I am using powershell to trigger commands on remote machine (as this doesn't require anything additional package to install). Recently I am facing issues with running commands on remote machine.

                                $ComputerName = "***.***.***.***"

                                Function ExecuteCommand() {
                                Get-PSDrive
                                }

                                Set-Item WSMan:\localhost\Client\Trustedhosts -Value $ComputerName -Concatenate -Force

                                $Credentials = Import-Clixml $CredentialsFile

                                Invoke-Command -ComputerName $ComputerName -Credential $Credentials -ScriptBlock ${function:ExecuteCommand} -HideComputerName

                                I am storing the credentials in the file and using the above script to run commands on remote machine.

                                1. Get-PSDrive doesn't return mapped network drive details.
                                2. using net use command to map network path. Network path gets mapped successfully but…

                                1 vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                • 1 vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Code analysis inside of a try block in a class thinks a variable isn't assigned when it is.

                                    Import-Module says that $variable2 is not assigned, but there is no way to reach its usage in the Write-Host without the variable having a value.

                                    Class MyClass {
                                    DoThing() {
                                    $variable1 = "var1"
                                    try {
                                    $variable2 = "var2"
                                    } finally {
                                    Write-Host "Tidying"
                                    }

                                    Write-Host $variable1
                                    Write-Host $variable2
                                    }
                                    }

                                    1 vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Start-Process EncodedCommand (RedirectStandardError) v5.1

                                      The following script demonstrates an issue I'm experiencing after moving from PowerShell v4 to v5.1. I make extensive use of Start-Process redirecting StandardError to a file, if this file contains data after execution I can read the file to see what the issue was.

                                      However, with v5.1 when the launched PowerShell process starts, it makes use of progress output which is on the error stream, so this is redirected to the error file.

                                      In previous versions of PowerShell this did not happen.

                                      The output to the script below is as follows:

                                      Powershell v4
                                      ------------------
                                      WARNING: Standard Error
                                      WARNING: Standard Out …

                                      1 vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        Signed in as (Sign out)

                                        We’ll send you updates on this idea

                                        1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Timing Invoke-WebRequest Is Slower in Console than ISE

                                        We are running a home-grown internet speedtest using a PowerShell script. When running the script in ISE on fast network connections (100mbps+), the Invoke-WebRequest commands run fast enough to reflect 100mbps. However, when the script is run through console, the Invoke-WebRequest is restricted and reports speeds of only 25mbps. How can the console be configured to run with the same resources as ISE?

                                        FYI, this is not an issue for slower networks. Only fast networks seem to expose the console bottleneck.

                                        2 votes
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          Signed in as (Sign out)

                                          We’ll send you updates on this idea

                                          1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Bug: -Exclude does not work as -Include does in Get-ChildItem, or as expected

                                          Three folders; d1, d2, d3, with files test.txt and test.mp3 in in d1 and d3.

                                          '-Include *d1*' includes only content from d1. Would expect '-Exclude *d1*' to include the inverse, but it has no effect, it returns all data.

                                          unless it's run after -Include.

                                          So '-Include *d1* -Exclude *d1*' returns nothing, as expected.

                                          Exclude only works as it applies to a file name, not a path.

                                          So '-Exclude *.txt' will exclude all files '*.txt' as expected.

                                          The syntax usage in the help file is identical for both parameters.

                                          Please fix -Exclude parameter so that it works on the Path consistently,…

                                          2 votes
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            Signed in as (Sign out)

                                            We’ll send you updates on this idea

                                            0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3 4 5 20 21
                                          • Don't see your idea?

                                          Feedback and Knowledge Base