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. Low performance when transferring long arrays between PSSessions

    I faced with the problem when I tried to recive long array (file system entries) from remote pssession. It is obvious that Powershell has problems with it.
    For reproduce it you should run next code:

    $session = New-PSSession localhost

    $arrayLen = 1024000
    Measure-Command{
    Invoke-Command -Session $session -ScriptBlock {
    Write-Host ("Preparing test array {0} elements length..." -f $using:arrayLen)
    $global:result = [Byte[]]::new($using:arrayLen)
    [System.Random]::new().NextBytes($result)

    }
    } |% {Write-Host ("Completed in {0} sec`n" -f $_.TotalSeconds)}

    Measure-Command{
    Invoke-Command -Session $session -ScriptBlock {
    Write-Host ("Transfer array ({0})" -f $using:arrayLen)
    return $result
    } | Out-Null
    } |% {Write-Host ("Completed in {0} sec`n" -f $_.TotalSeconds)}

    Measure-Command{
    Invoke-Command -Session…

    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 →
    • A strange idea: why not work using pipeline objects, e.g. in Add-WindowsCapability?

      Microsoft is proud that PowerShell works with objects and never gets tired of announcing this wonderful achievement everywhere.

      Now I have an apparently extraordinary idea:

      Why does M$ not *always* and mandatory work with the objects, so that commands of the same subject automatically understand each other?

      This would allow us commands as we expect it. Without googling for solutions... once more. Such commands must simply work:

      Get-WindowsCapability -Online? Name -like' OpenSSH. Client*'. | Add-WindowsCapability

      The current M$ "solution" is that very often we have to handle properties and therefore we fall back to the string handling.

      Annoyoing.
      Very Annoyoing…

      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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
      • [BUG] addition error in assignment operator +=

        [Environment]

        Name Value
        ---- -----
        PSVersion 5.1.16299.15
        PSEdition Desktop
        PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
        BuildVersion 10.0.16299.15
        CLRVersion 4.0.30319.42000
        WSManStackVersion 3.0
        PSRemotingProtocolVersion 2.3
        SerializationVersion 1.1.0.1

        [Bug]

        Consider this code:

        [int]$end = 100
        [double]$Increment = 0.1

        1..$End | Foreach-Object {[double]$t += $Increment ; "$_ $t"}

        I'd expect the output always to give the line number and the current total, but look what happens at lines 60 and 101:

        >54 5.4
        >55 5.5
        >56 5.6
        >57 5.7
        >58 5.8
        >59 5.9
        >60 5.99999999999999
        >61 6.09999999999999
        >62 6.19999999999999
        >63 6.29999999999999
        >64 6.39999999999999
        >65 6.49999999999999
        ....
        96 9.59999999999998
        97 9.69999999999998
        98 9.79999999999998
        99 9.89999999999998
        100…

        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 →
        • Implement `runas.exe` counterpart with `netonly` and `NoNewWindow` switches

          I need to open Powershell console (within the same window) as different user with /netonly option known from the runas.exe command. I would like to avoid typing manually passwords, because I will use this console to run some scripts automatically.

          As far as I know if it currently impossible.
          I added appropriate question on SO: https://stackoverflow.com/questions/48882958/powershell-open-new-console-as-different-user-in-the-same-window-runas-neto

          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 a way to contact us on the contact us page

            You've clearly deleted all the contacts on the Contact Us page to stop people contacting you to inform you how broken your applications and website are, fix it or just stop being cowards and delete the page or change it to "we have no interest in you contacting us"

            https://www.powershellgallery.com/policies/Contact

            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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →

              If you have an issue with the Gallery, please identify what the issue is. You may use this forum, which you have clearly located, or the contact us page. We welcome any constructive feedback you may have.

              The Contact Us page provides the ability to send email to an alias that is closely monitored by all PowerShell Gallery administrators.

            • Add-Content should create folder but returns error

              According to this documentation Add-Content should create a folder when it does not exist: "This command creates a new directory and file and copies the content of an existing file to the newly created file."

              https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-content?view=powershell-5.1

              However, I get an error: "Add-Content : Could not find a part of the path 'C:\tests\test134\logs\test134.log'."

              Seems like a clear issue to me. Either in the documentation or the functionality.

              BR Matthias

              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 →
              • Powershell 5 documentation for command Where-Object has a typo

                Example 4 in help documentation for Where command has a typo (-GEe):

                Example 4: Use the comparison statement format

                PS C:\>Get-Process | Where-Object -Property Handles -GE -Value 1000
                PS C:\> Get-Process | where Handles -GEe 1000

                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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
                • Get-Acl WebDAV error because of @SSL

                  After connecting to a SharePoint Online site or a OneDrive 4 Business site as a external drive (https://support.microsoft.com/en-us/help/2616712/how-to-configure-and-to-troubleshoot-mapped-network-drives-that-connec) you get an code 1 error when executing Get-Acl on this WebDAV path.
                  I assume is because of the @ssl part in the path.

                  Steps to reproduce:
                  Get-Acl -Path \customer-my.sharepoint.com**@ssl**\DavWWWRoot\personal\user_customer_com\Documents

                  Expected behavior:
                  Acl's are returned for the item (file or folder).

                  Actual behavior:
                  error code 1 is returned.
                  "Get-Acl : Method failed with unexpected error code 1."

                  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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                  • Fix the typo in the shortcut of PowerShell Core 6 for Windows

                    This shouldn't take more than one minute of the developer's time, right?

                    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                    • write-error writes entire script code to error window before writing the error message

                      write-error writes entire script code to error window before writing the error message.

                      If you use write-error to write an error message in Azure Automation or in an unsaved script in PowerShell ISE, it will write the entire script to the error stream before writing the actual error message.

                      Running this in the PowerShell ISE

                      write-verbose "We shouldn't see this in the error stream"
                      get-process notepad
                      Write-Error -Message "Error"

                      Returns this

                      PS C:\Users\bmcder> write-verbose "We shouldn't see this in the error stream"
                      get-process notepad
                      Write-Error -Message "Error"

                      Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
                      ------- ------ ----- ----- ------…

                      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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                      • Transcript does not log the Verbose and Warning stream of Receive-Job

                        Problem
                        ------------------------------------------------------
                        When we run a job inside a transcript, the Verbose and the Warning streams of the jobs are not displayed in the transcript. However, we can see the in the console correctly.

                        Steps to reproduce
                        --------------------------------------------
                        Run the following script
                        Start-Transcript -Path 'C:\Logs\DemoJobsTranscriptOutput.txt' -Append | Out-Null

                        $VerbosePreference = "continue"
                        $WarningPreference = "continue"

                        $jobs = @()

                        $jobs += Start-Job -ScriptBlock {
                        $VerbosePreference = "continue"
                        $WarningPreference = "continue"
                        "Begin job"
                        Write-Verbose "Verbose!"
                        Write-Warning "Warning!"
                        "End job"
                        } -Name "Demo"

                        $jobs | Wait-Job | Out-Null

                        $jobs | % {
                        "Result for job '$($_.Name)'"
                        $_ | Receive-Job -Verbose
                        }

                        $jobs | Remove-Job…

                        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 →
                        • Find-Package does not search all sources if -Source parameter is not supplied

                          I have cross posted this to the PowerShell core repo too as the same issue exists in v6 https://github.com/PowerShell/PowerShell/issues/6100

                          to reproduce:

                          Register-PackageSource -Name "nugetv2" -ProviderName NuGet -Location "http://www.nuget.org/api/v2/"

                          get-packagesource

                          Name ProviderName IsTrusted Location
                          ---- ------------ --------- --------
                          nuget.org NuGet False https://api.nuget.org/v3/index.json
                          nugetv2 NuGet False http://www.nuget.org/api/v2/
                          PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2/

                          Find-Package npgsql

                          expected:
                          result returned with or without -source nugetv2

                          acual: omitting source parameter returns package not found

                          This is on Powershell 5.1 on windows 8.1

                          Name Value
                          ---- -----
                          PSVersion 5.1.144
                          PSEdition Desktop
                          PSCompatibleVersions {1.0, 2
                          BuildVersion 10.0.14

                          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  ·  Package Management  ·  Flag idea as inappropriate…  ·  Admin →
                          • convertfrom-string and rounding

                            I have been parsing some log files into JSON type data and have run across a couple of 'issues'. As response is appreciated as I have searched for two weeks and not found any references to these 'issues'.

                            Converting the following line results in the truncation of the decimal.

                            convertfrom-string "Sat Dec 16 00:00:04 2017 Info: ICID 182588587 REJECT SG BLACKLIST match sbrs[-10.0:-3.0] SBRS -4.4 country United States"

                            Results in:
                            P1 : Sat
                            P2 : Dec
                            P3 : 16
                            P4 : 00:00:04
                            P5 : 2017
                            P6 : Info:
                            P7 : ICID
                            P8 : 182588587
                            P9 : REJECT
                            P10 : SG …

                            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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                            • log2(45/120) * 2 should be interpreted as (log2(45/120)) * 2

                              Given a function:
                              function log2 {param ([double]$x) [Math]::Log($x) / [Math]::Log(2) }

                              Expected: log2(45/120) * 2 is interpreted as (log2(45/120)) * 2 and yields -2.83007499856

                              Actual: log2(45/120) * 2 equals log2(45/120) and yields -1,41503749927884

                              (log2(1/2) * 3) -eq (log2(1/2)) yields True - it doesn't make sense.

                              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 →
                              • get-help output

                                In the output of get-help the examples are listed and there are no lines separating examples from the end of the previous description. This is very confusing and difficult to read.
                                Just an extra line between the end of the description of the example and the next example would make a huge difference.
                                eg:

                                Example 1: Apply configuration settings

                                PS C:\> Start-DscConfiguration -Path "C:\DSC\Configurations\"

                                This command applies the configuration settings from C:\DSC\Configurations\ to the every computer that has settings in that folder. The
                                command returns Job objects for each target node deployed to.
                                [put a break here] Example 2: Apply…

                                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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
                                • Alias $PSVersionTable.PSVersion to a sensible command

                                  Determining the version of powershell requires the memorization of this silly, circuitous command: $PSVersionTable.PSVersion

                                  Can we please alias this to something more rational. I'm tired of googling "powershell version command" every time I forget the name of the table.

                                  It would be much better to have something guessable like:

                                  powershell --version

                                  or

                                  help version

                                  etc.

                                  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 →
                                  • RegEx pattern match causes infinite loop

                                    The following pattern match causes infinite loop.

                                    '"name":"XYZ" Go to Library for reading' | select-string -Pattern '"(.*)+"'

                                    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                                    • get-adcomputer will not bind properly to another function even when it contains a valid string parameter with the 'name' alias.

                                      Bug filing.

                                      According to other articles I read this problem may be prevalent in other/all AD cmdlets. To work around this bug you have to use | Select * | as an intermediate step to correctly bind to your $computername/$name parameter.

                                      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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                                      • DSC Archive Resource (unzip) holds zip-file

                                        This is more a indirect failure experience. Please bear with me if this is the wrong place: Expanding a zip-file with DSC in an Archive Resource leaves a process holding the zip-file. This gives that the zip-file can not be deleted by the same script or in the same PowerShell session.
                                        The error message from Remove-Item on the zip-file is like this: "Remove-Item : Cannot remove item C:\temp\jjdk1.8.0_112-CE.zip: The process cannot access the file 'jdk1.8.0_112-CE.zip' because it is being used by another process.".
                                        In issue 240 to Plaster on GitHub (https://github.com/PowerShell/Plaster/issues/240) it is mentioned by Keith Hill (rkeithhill)…

                                        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  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
                                        • How to put credentials in powershell script in secure form?

                                          I want to put credentials in ps script in secure form, such that if anyone else checks/reads my script he/she should not be able to see my credentials in script.

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

                                          Feedback and Knowledge Base