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. Remote Invoke-Command with -ScriptBlock changes types of arguments if scripblock contains variables

    What's going on here???

    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name}
    ScriptBlock
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3}
    String
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name}
    ScriptBlock
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3}
    String

    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

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

      17 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: Shell crashing with x509Certificate2 objects

        Problem:

        When creating an object from the x509Certificate class the shell adds 3 script properties:

        DnsNameList
        EnhancedKeyUsageList
        SendAsTrustedIssuer

        The SendAsTrustedIssuer property causes Powershell to hit a CLR exception and hard crash when accessed.

        Repro Code:

        * Note: do this in a fresh session as it will crash the session

        $Test = New-Object System.Security.Cryptography.x509Certificates.x509Certificate2
        $Test | select *

        Alternately,

        $Test = New-Object System.Security.Cryptography.x509Certificates.x509Certificate2
        $Test.SendAsTrustedIssuer

        Crash dump:

        Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
        at System.Management.Automation.Security.NativeMethods.CertGetCertificateContextProperty(IntPtr pCertContext, CertPropertyId dwPropId, IntPtr pvData, Int32& pcbData)
        at Microsoft.PowerShell.Commands.SendAsTrustedIssuerProperty.ReadSendAsTrustedIssuerProperty(X509Certificate2 cert)
        at CallSite.Target(Closure ,…

        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 →
        • Move-AzureRmDataLakeStoreItem not working in newer versions of module

          I created a runbook on several automation accounts that move around files and folders on Datalake Storage Accounts (gen 1). The runbook works without hitches on 2 automation accounts, but did not work on the other 2.

          There were quite a few differences in the versions of the added modules: the runbook worked on the older versions of the modules, but not the newer. Specifically the cmdlet Move-AzureRmDataLakeStoreItem threw an error on the newer versions:
          "Account name ***.azuredatalakestore.net/ is invalid. Specify the full account including the domain name."

          After trying quite a few iterations of writing the account name (just…

          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 →
          • 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 →
            • SMTPEventConsumer doesnt format message body properly

              I found a bug in PS 4.0 when working with SMTPEventConsumers. The bug I found truncated the string used for the "Message" property of the SMTPEventConsumer. The code truncated anything after the first 16 characters. It didn't matter what I used for an escape sequence, formatted as here string, nothing worked. I ran the exact same code on a PS 5.1 host and the SMTP message was formatted exactly as expected. For more indepth info I have included a link to the thread I started on TechNet for this issue.

              https://social.technet.microsoft.com/Forums/en-US/62c4552b-b5e8-4bf3-ac74-6c5f1668af9f/issues-properly-formatting-smtpeventconsumer-message-body-in-powershell?forum=ITCG

              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 →
              • Transfer $DebugPreference and $VerbosePreference to New-PSSession

                I want a PSSessionOption that says to transfer over common applicable session level variables over to the remote session, specifically $DebugPreference and $VerbosePreference.
                $DebugPreference = 'continue'
                $PSSession = New-PSSession -ComputerName 'localhost'
                Write-Debug $DebugPreference # Writes 'continue'
                Invoke-Command -ScriptBlock {Write-Debug $DebugPreference} -Session $PSSession # Writes nothing

                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 →
                • 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 →
                  • Merge "Windows PowerShell" and "PowerShell Core", make result default on Windows

                    When sending code to someone, I don't want to have to qualify the post with "if it doesn't work, try the *other* PowerShell...". I know there will be OS-specific modules/commands, but there should *not* be two code bases for the shell itself, or two product names.

                    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

                      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 →
                      • Write-Host -NoNewLine and Transcription

                        Starting with WMF 5.0 the -NoNewLine option for Write-Host is essentially ignored in the transcripts created using Start-Transcript.

                        Simple example script:

                        Start-Transcript log.txt
                        Write-Host -NoNewLine "this should all"
                        Write-Host -NoNewLine "be on one line"
                        Write-Host -NoNewLine "in the log.txt file"
                        Stop-Transcript

                        12 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

                          3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                        • Out of the box support for YAML like csv / xml / json

                          Votes from Connect: 25

                          Original Date Submitted: 4/16/2015 7:34:07 PM

                          Description:
                          ********Contact Information********
                          Handle: ducke
                          Site Name: PowerShell
                          Feedback ID: 1252364
                          ***************************************

                          Problem Description:
                          In the "DevOps" world, YAML is a first class citizien in products like Kitchen CI, Elasticsearch, Appveyor, Travis CI, rubocop etc.
                          It would be great to have commands similar to https://github.com/dfinke/PowerYaml native without the need to import a module.

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

                          Repro Steps:

                          Internal BugId: 14385

                          59 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 →
                          • 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 →
                            • Bug in WMF5 with inaccessible network path in PSModulePath environment variable

                              In WMF5, if the PSModulePath environment variable has a UNC Path in it that is currently inaccessible, powershell fails to load many built-in modules.

                              For instance, if PSModulePath looks like this:

                              C:\Users\jmmurrah\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules;\\badservername\folder

                              When powershell loads and times out trying to access the path, many standard cmdlets are not found; get-host, test-path, format-list, etc.

                              Get-member -listavailable reports back the modules, but does not list their path on disk, and many of them have no exported commands. When trying to import one of these modules powershell reports an error that the module path cannot be found.

                              This doesn't appear to happen…

                              7 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 →
                              • 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…

                                15 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 →
                                • 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]…

                                  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

                                    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…

                                    13 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 →
                                    • 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
                                      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 →
                                      • 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

                                        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

                                          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 →
                                          ← Previous 1 3 4 5 20 21
                                          • Don't see your idea?

                                          Feedback and Knowledge Base