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. ISE should not switch focus automatically to the console pane

    Starting from Windows 10 1803, when you run a selected block of code using F8, ISE switches focus to the console pane. This means that when you run several of these, you have to manually switch the focus back to the script pane after each execution.

    This is much more difficult than before, so please fix this.

    38 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

      7 comments  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
    • 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 →
        • Import-json

          json is becoming the new standard (if not already)
          It would be nice to have an import-json and a export-json as we have in xml/csv instead of the two steps process with get-content and convertfrom-json and convertto-json.

          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

            0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
          • Powershell ISE win10 1803 Cursor swaping panes on run

            Since windows 10 1803 when running a script from the script pane, the cursor switches from the script pane to the console pane.

            To reproduce: Open powershell ise on windows 10 1803. Enter in a basic script (ex: Write-Host "test") and hit F5. The cursor will move to the console pane so if you start typing the output will be in the console pane.

            The expected behavior would be to leave the cursor in the script pane so that you can continue to edit the script. This was the behavior previous to windows 10 1803.

            29 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

              4 comments  ·  ISE and tooling  ·  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 →
              • Bug: Powershell Get-Help does not work with Exchange Online cmdlets

                We've been lucky, from what I'm gathering from web searches! Until December last year, Exchange Online Powershell cmdlet help was available using Get-Help in the shell. However, after the Christmas break, the only response we get is:

                Get-Help : Exception calling "Invoke" with "0" argument(s): "Cannot find path '' because it does
                not exist."
                At line:1 char:1
                + Get-Help Get-Mailbox
                + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
                + CategoryInfo : NotSpecified: (:) [Get-Help], MethodInvocationException
                + FullyQualifiedErrorId : CmdletInvocationException

                It's the same issue irrespective of the cmdlet.

                Consequently, I'm forced to contend with painful searches of the documentation website for information of the relevant cmdlets.

                Raised…

                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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                • Get-Help NOTES section identation issue

                  When we run get-help on cmdlet which has .NOTES the output is unusually indented, even though there is no tab in function documentation.

                  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 →
                  • 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 →
                    • Missing newer computer account in Get-LocalUser on a DC

                      in PowerShell 5.1.14393.2608 when I run Get-LocalUser * on a Windows Server 2016 Domain Controller I should get a list of all domain user and computer. But the newest Domain joined computer is missing.
                      Please fix this.
                      Also when I run Get-LocalUser MyComputer$ and MyComputer is the last domain joined computer I get ObjectNotFound

                      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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                      • Bug: Ps1 script file with extra extension gets deleted when called from CMD

                        When calling PowerShell from CMD and specifying a script file that contains an extra "extension" (extra dot) in the base name, the script is not run but the file is mysteriously deleted:

                        Example (run in CMD):

                        powershell -file c:\temp\script.txt.ps1

                        The same issue when called like this:

                        powershell -command "& c:\temp\script.txt.ps1"

                        This has been reproduced by me and others on different machines with different paths.

                        The same issue exists when called from inside PowerShell like this:

                        . "powershell.exe" -file c:\temp\script.txt.ps1
                        Start-Process "powershell" -Arg "-file, "c:\temp\script.txt.ps1"

                        Note that these will work just fine:

                        powershell -command "& 'c:\temp\script.txt.ps1'"
                        powershell -command ";& c:\temp\script.txt.ps1"
                        powershell…

                        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 →
                        • How to create external trust relationships between two domains?

                          How to create external trust relationships between two domains, such as aaa.com and bbb.com. I haven't seen a similar demo for two days.
                          Looking forward to your reply.

                          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 →
                          • 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 →
                            • high CPU

                              Found out when my CPU is high (99%-100) (i do set executionpolicy to remotesign/unrestricted also)
                              When i run the PS script, it will ask for executionpolicy.
                              but when i low CPU, it will just run the script.

                              suspect value (executionpolicy remotesign) unable to pass thru to script.ps1 on time. so it prompt out everytime when CPU is high.
                              do we have some setting to tune this. delay it, so that executionpolicy have more time to pass the value to script.ps1.

                              ---------------------------------
                              Script:
                              $sourcefolder="D:\A743"
                              $datenow = get-date
                              $processdate = (get-date).Adddays(-3)

                              get-childitem $sourcefolder -file | where-object { $_.lastwritetime -le $processdate } |…

                              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 →
                              • Kill a specific IIS request

                                Sometimes there are single requests which are hanging in IIS.
                                It would be good to kill such a single request without killing the whole process because that can cause a lot of time until a big web application is running again.

                                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 →
                                • New PowerShell Tab should place cursor into console pane input line (Regression)

                                  After opening "New PowerShell Tab" either using Ctrl+T shortcut or by clicking menu item, tab title gets keyboard focus. Instead, cursor should be placed into input line of console pane.
                                  This was the way previous versions of ISE worked (before Windows 10).

                                  See video demo: https://www.youtube.com/watch?v=0fzk1VEQpo0

                                  (Opening new tab using Ctrl+T, look closely at tab title with dashed line border).

                                  Windows 10 version 10.0.17763.134
                                  PowerShell ISE version 5.1.17763.134

                                  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  ·  ISE and tooling  ·  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 →
                                    • BUG: Get-Help <word> doesn't search content of about_* files unless -Category HelpFiles parameter is specified

                                      The help text for the -Name parameter of Get-Help says:
                                      "...If you enter a word that does not match any help topic titles, Get-Help displays a list of topics that include that word in their contents."

                                      Example:
                                      PS> Get-Help exit

                                      Only returned two cmdlets that have the word 'exit' in their name.

                                      PS> Get-Help exit -Category HelpFile

                                      Returns about_* topics where the word 'exit' is found.

                                      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 →
                                      • 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 →
                                        • issue with encrypted mofs on a pull server [partialconfigs]

                                          i have a pull server with 2 non-encrypted mofs, and 1 encrypted mof. The LCM on the lab node is configured to pull the 3 different configs as partialconfigs. When I run Start-DSCConfiguration, the encrypted mof fails with the following:

                                          PowerShell DSC resource MSFT_UserResource failed to execute Set-TargetResource functionality with error message: There could be a possible multiple matches exception while trying to use the System.DirectoryServices API's.Exception calling "Save" with "0" argument(s): "The
                                          password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.
                                          "
                                          + CategoryInfo : InvalidOperation: (:) [], CimException …

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

                                          Feedback and Knowledge Base