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. Expand-Archive does not return a System.IO.FileInfo nor System.IO.DirectoryInfo

    The docs clearly say that Expand-Archive should return a System.IO.FileInfo or System.IO.DirectoryInfo but it has no output

    1 vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)

      We’ll send you updates on this idea

      0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
    • WMF 5.1 breaks class registrations for the ConfigMgr client agent

      I've localized this issue to WMF 5.1 on Windows 7. With this installed, the WMI namespace: root\ccm\policy\defaultmacine\requestedconfig becomes invalid. This is important because in In-Place upgrade scenarios from Windows 7 to Windows 10, the task sequence agent cannot resume the task sequence without being able to read this namespace. I know this is a combination of WMF and ConfigurationManager so I will post there as well.

      1 vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)

        We’ll send you updates on this idea

        0 comments  ·  WMI  ·  Flag idea as inappropriate…  ·  Admin →
      • Bug: Integrated Modules are not loaded if you have a Network Path in $env:PSModulePath which is not reachable

        Integrated Modules are not loaded if you have a Network Path in $env:PSModulePath which is not reachable.

        ##############
        I have customized the PSModulePath:

        PS C:\Users\username> ($env:PSModulePath).split(';')
        C:\Users\username\Documents\WindowsPowerShell\Modules
        C:\Program Files\WindowsPowerShell\Modules
        C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
        c:\Program Files\Microsoft Security Client\MpProvider\
        C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell\
        \\my.domain\share\Modules\

        ##############
        If i try to execute e.g. Invoke-RestMethod

        PS C:\Users\username> Invoke-RestMethod
        Invoke-RestMethod : The 'Invoke-RestMethod' command was found in the module 'Microsoft.PowerShell.Utility', but the
        module could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Utility'.
        At line:1 char:1
        + Invoke-RestMethod
        + ~~~~~~~~~~~~~~~~~
        + CategoryInfo : ObjectNotFound: (Invoke-RestMethod:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule


        PS C:\Users\username> Get-Command Invoke-RestMethod
        Get-Command : The term…

        1 vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)

          We’ll send you updates on this idea

          1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
        • Slow "." hash lookups

          Slow "." hash lookups (more than 100 times slower than []) from PowerShell Version 2 to Version 5.1

          This could be either a documentation problem or a bug. The documentation never says that the "." hash lookup can be much slower than the [] lookup. I hope it is a bug (one less thing to remember). They both worked at the same speed in PS Version 2.0 and diverged sometime after that.

          Two script files. The first calls the second forcing versions 1 thru 5 of PowerShell.

          The "." hash lookups in PS Version 2.0 take .028 seconds.
          The "."…

          1 vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)

            We’ll send you updates on this idea

            0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
          • PowerShell Query returns nothing

            I am trying to do a query to obtain setting values of RSOP_SecuritySettingBoolean in PowerShell (and WMI) but it returned nothing. The following query I attempted:

            E:\>PS E:\> Get-WmiObject -Namespace "root\RSOP\Computer" -Query "SELECT setting FROM RSOP_SecuritySettingBoolean Where KeyName='ClearTextPassword' and precedence='1'"

            PS E:\>

            For your extra information:

            E:\>ver

            Microsoft Windows [Version 10.0.14393]

            PS E:\> $psversiontable

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

            My Windows 10 OS is still fresh, installed about 2 months ago via ISO. Why is it not returning any results? Please help.…

            1 vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)

              We’ll send you updates on this idea

              0 comments  ·  WMI  ·  Flag idea as inappropriate…  ·  Admin →
            • BUG: PowerShell xml node assignment with where-method

              Doing this works:
              ($xmlDoc.unattend.settings.Where({$_.pass -eq "specialize"}).component.Where({$_.name -eq "Microsoft-Windows-Shell-Setup"}) | Where-Object {$true}).ComputerName = "Test02";
              But without "| Where-Object {$true}" it fails.

              https://social.technet.microsoft.com/Forums/en-US/6801cfda-4699-4c2b-8a84-7d12de76e51d/powershell-xml-node-assignment-bug?forum=ITCG

              1 vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)

                We’ll send you updates on this idea

                0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
              • DSC need to use full width of command processor in output

                DSC output is not respecting width of console and wraps text around despite full width is not utilized.
                Please see details here (https://github.com/PowerShell/PowerShell/issues/4030)

                1 vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
                • Please Offer file attachment option for Feedback or Bug Report

                  Please Offer file attachment option for Feedback or Bug Report! This Option makes issue Reporting much Simpler & Clearer to explain & describe a specific issue/s!

                  1 vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                  • Enable WINRM certificate mapping for domain user

                    Currently I need to manage Windows DNS server. I would like to use a client certificate to connect to WinRM to manage it, since I want to expose it in RESTful interface. But WINRM certificate mapping only allows non-domain account.

                    1 vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      0 comments  ·  WinRM  ·  Flag idea as inappropriate…  ·  Admin →
                    • Get-TargetResource should not use 'Required' parameters

                      I'm not sure why this is, but for some reason Get-TargetResource requires not only the 'Key' parameters, but also the 'Required' parameters. My understanding is only 'Keys' should be necessary to find an existing resource and the 'Required' parameters are necessary when you want to create/update/delete something related to a resource.

                      This really makes no sense and will hinder our ability to build higher level tech on top of DSC. If I have the key values for any piece of data in any system, I should be able to retrieve it without any additional information.

                      In almost all of the…

                      1 vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
                      • [Bug] Test-Path -PathType Containers Allows Users to Bypass Security Restrictions on Existence Testing

                        Under PowerShell 5.1, the Test-Path command will return a [UnauthorizedAccessException] when you try to test a path the current user does not have access to. Normally this error is uncatchable, but it becomes so if you set the PathType to Container. Despite the name, Test-Path will verify the existence of both Containers and Leafs in this mode. Because the [UnauthorizedAccessException] error is ONLY returned for extant files and folders, a user can use it to confirm the existence of files and folders they should not be able to see or access.

                        This one-liner allows you to bypass security restrictions:
                        try{…

                        1 vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                        • Inconsistant handling of native command stderr

                          I discovered recently that the handling of `stderr` from native commands isn't being dealt with consistently between Windows PowerShell and Windows PowerShell ISE.

                          Steps to reproduce
                          ------------------

                          ```powershell
                          $errorActionPreference="stop"; try { cmd /c nosuchexe } catch { 'dang!' }
                          ```

                          Actual ISE behavior (expected)
                          -----------------

                          ```none
                          dang!
                          ```
                          Native commands writing to `stderr` while `$errorActionPreference="stop"` generate a catchable `NativeCommandError` which encapsulates the original error message in a `ErrorRecord`. It is easy to capture, analyze, and reword error messages in context.

                          Actual CLI behavior
                          ---------------

                          ```none
                          'nosuchexe' is not recognized as an internal or external command,
                          operable program or batch file. …

                          1 vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                          • what works?

                            list what works?

                            1 vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                            • Provide a native ternary operator

                              It would be very nice and convenient if PowerShell had a native ternary operator like C# does (https://msdn.microsoft.com/en-us/library/zakwfxx4(v=vs.100).aspx).

                              Basically it would allow you to write a short-hand if-else statement, so instead of having to write:

                              if ($someBoolCondition)
                              {
                              $x = $y.Property1
                              }
                              else
                              {
                              $x = $y.Property2
                              }

                              you could just write:

                              $x = $someBoolCondition ? $y.Property1 : $y.Property2

                              This operator is fairly standard in many programming languages, so it would be awesome if PowerShell could come up to speed with it as well. Thanks.

                              1 vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                              • Do not require starting brace to be on same line as cmdlet

                                It is very annoying and confusing that some cmdlets require the starting brace to be on the same line as the cmdlet, while others do not.

                                For example, this is valid:

                                ... | ForEach-Object {
                                $sourcefile = $_.Name
                                }

                                but this is not:

                                ... | ForEach-Object
                                {
                                $sourcefile = $_.Name
                                }

                                yet using this is valid:

                                foreach ($x in $y)
                                {
                                $sourcefile = $_.Name
                                }

                                I know that you can use the backtick to make it valid, like this:

                                ... | ForEach-Object `
                                {
                                $sourcefile = $_.Name
                                }

                                but that's still not intuitive and requires you to remember to do…

                                1 vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                • Foreach Does Not Run If Statements For Array Elements

                                  Copy and run with -Debug. You'll see...

                                  function Get-ArrayDups([array]$ArrayCheck, $IOI) {
                                  $indices = @()

                                  For($i=0;$i -le $ArrayCheck.Length; $i++) {If ($IOI -eq $ArrayCheck[$i]) {$indices += $i}}
                                  "Variable `$indices = " + $indices
                                  "`$ArrayCheck[0] = " + $ArrayCheck[0]
                                  "`$ArrayCheck[9] = " + $ArrayCheck[9]
                                  }

                                  Function Get-ArrayDups {
                                  [cmdletbinding()]
                                  Param(
                                  [Parameter(ValueFromPipeline = $true)]
                                  [Array]
                                  $ArrayContent,

                                  [int]
                                  $IOI
                                  )
                                  BEGIN { [array]$indices = @()
                                  $Len = $ArrayContent.Count
                                  $i = 0
                                  Write-Debug "Initial Value: `$Len = $Len"
                                  Write-Debug "Initial Value: `$ArrayContent[`$Len] = $($ArrayContent[$Len-1])"
                                  Write-Debug "Initial Value: IOI is $IOI"
                                  Write-Debug "Initial Value: The full passed in array is $ArrayContent"
                                  Write-Debug "Initial Value: Length of `$indices…

                                  1 vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                  • ExecutionPolicyOverride-Problem with GPO in place on Server 2016

                                    I'm preparing some "Windows Server 2016" machines. While testing I stumbled across some issues with PowerShell.
                                    I invested some time and narrowed it down a bit.

                                    I also posted the issue on Microsoft Technet Forum and got the recommendation to file a Bug/Request here. Other users were also able to reproduce it quite easily:
                                    (see: https://social.technet.microsoft.com/Forums/en-US/842c2cc2-c7f6-41b7-9561-31b2c65262b0/executionpolicyoverrideproblem-with-gpo-in-place-?forum=winserverpowershell)

                                    Steps to reproduce:

                                    I create a new VM, insert the Server 2016 ISO, boot up and install. After first start I change the network-settings for my environment and join the domain. I move the new computer-object to an OU where the group policy…

                                    2 votes
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Bug when loading functions with custom classess from One Drive folder in Windows 10

                                      Loading scripts with custom classes fails when loading file from One Drive folder location

                                      1 vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)

                                        We’ll send you updates on this idea

                                        0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Select-String with pipe Bug

                                        Type : adb logcat | Select-String --Patern "xyz"

                                        Known : Pattern argument take only one "-"

                                        As adb logcat output data contniously which is piped with select string
                                        command if we use two "-" with patern argument then powershell stucks in endless loop with its error output

                                        Sugession : Please do proper error handling in arguments also

                                        1 vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)

                                          We’ll send you updates on this idea

                                          0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Unregister-ScheduledJob -Name 'Name' -WhatIf does not honor WhatIf

                                          Steps to reproduce

                                          Import-Module PSScheduledJob
                                          Register-ScheduledJob -Name 'test' -ScriptBlock {echo 'hello world'}
                                          Unregister-ScheduledJob -Name test -WhatIf
                                          Get-ScheduledJob

                                          Expected behavior

                                          I expect the job to still be there.

                                          It does work with Unregister-ScheduledJob -Id 11 -WhatIf.

                                          Actual behavior

                                          The scheduled job is corrupted.

                                          Get-ScheduledJob : Cannot get the test scheduled job because it is corrupted or in an irresolvable state. Because
                                          it cannot run, Windows PowerShell has deleted test and its results from the computer. To recreate the scheduled
                                          job, use the Register-ScheduledJob cmdlet. For more information about corrupted scheduled jobs, see
                                          about_Scheduled_Jobs_Troubleshooting.

                                          Environment data

                                          > $PSVersionTable
                                          Name Value
                                          ---- ----- …

                                          1 vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)

                                            We’ll send you updates on this idea

                                            0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3 4 5 57 58
                                          • Don't see your idea?

                                          Feedback and Knowledge Base