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. PowerShell Compare-Object odd output when comparing recursive items with -Exclude

    This works:

    $one = Get-ChildItem -Recurse -Path $PathLocal
    $two = Get-ChildItem -Recurse -Path $PathMirror
    Compare-Object -ReferenceObject $one -DifferenceObject $two

    This gets the wrong result:

    $one = Get-ChildItem -Recurse -Path $PathLocal -Exclude *.txt
    $two = Get-ChildItem -Recurse -Path $PathMirror -Exclude *.txt
    Compare-Object -ReferenceObject $one -DifferenceObject $two

    Somehow -Exclude is breaking the functionality.

    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 →
    • use semi-colon as line separator

      `
      do you see that? that's the line continuation line in PS. very hard to notice because maybe you think it's a dirt on the screen or on a book.

      would be better if lines continue until it meets a semi-colon. yes just like in C. a semi-colon is easier to notice and you wouldn't mistake it for a dirt on the screen.

      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 →
      • provide switches for toggles

        admit it, PS is ugly. with the multitudes of loops we have to jump thru to get a desired result, it would be better if you could provide command line switches for common tasks.

        for example, in a select statement, how do you prevent the header from appearing in the output? would be nice if could just do "select -NoHeader …." but you can't.

        that is just one example where I spent 30 minutes looking for a way to display only without headers in a "select" statement. a lot of our searches involves either an object has or has not…

        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 →
        • Inconsistent Array Initialization Behaviour

          Creating an array of arrays as below works well:

          $myArray = @(
          @(1,2,3),
          @(4,5,6)
          )
          $myArray[0] #outputs 1, 2, 3
          $myArray[1] #outputs 4, 5, 6

          $myBuggyArray = @(
          @(1,2,3)
          ,@(4,5,6)
          )
          $myBuggyArray[0] #outputs 1
          $myBuggyArray[3] #outputs 4, 5, 6

          I wouldn't expect the order of line break & comma to impact the behaviour of the command / can't find any documentation stating that it should.

          PSVersion: 5.1.14409.1012

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

            We’ll send you updates on this idea

            3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
          • Order is wrong in subsequent execution of loops

            Let's take this simple loop:

            PS C:\temp> for ($a=0; $a -lt 2; $a++ ) {
            >> get-date;
            >> Write-Host "Hello world!";
            >> Get-ChildItem | ft -a;
            >> sleep 1
            >> }

            18 juillet 2018 14:54:47
            Hello world!

            Directory: C:\temp

            Mode LastWriteTime Length Name
            ---- ------------- ------ ----
            -a---- 2018-07-18 14:49 3698 test.txt

            Hello world!
            18 juillet 2018 14:54:48

            Directory: C:\temp

            Mode LastWriteTime Length Name
            ---- ------------- ------ ----
            -a---- 2018-07-18 14:49 3698 test.txt

            As you can see, "Get-Date" and "Hello world!" gets inverted.

            If we remove "ft -a" everything is executed as it should.

            Using While ($true) { ... }…

            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 →
            • Out-Printer appears to mishandle tab characters

              Tab characters in strings sent to Out-Printer appear to be mishandled:

              * Printing to an XPS or PDF document quietly *strips* tab characters.

              * Printing to the 'Generic / Text Only' printer results in a broken 2-line / 2-column layout.

              Verify with the following commands:

              ```powershell

              "col1`tcol2" | out-printer 'Microsoft XPS Document Writer'
              "col1`tcol2" | out-printer 'Microsoft Print to PDF'

              "col1`tcol2" | out-printer 'Generic / Text Only'

              ```

              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 →
              • Terminating error in if statement script block generates duplicate errorvariable entries

                Consider the following 2 functions (contrived to illustrate the issue).

                function 1error { [CmdletBinding()] Param(); throw "This produces 1" }
                function 2error { [CmdletBinding()] Param(); if($true) {throw "This produces 2"} }

                If you call the function 1error with an error variable, the error variable will act as expected.

                1error -ErrorVariable +1var
                $1var.count #results in 1

                If you call function 2error with an error variable, the error variable will have 2 identical errors.

                2error -ErrorVariable +2var
                $2var.count # results in 2

                PSVersion is 5.1.14393.2189

                4 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 →
                • 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 →
                  • Set-mpioSetting -NewRetryInterval input validation is too strict

                    When I run the following command in powershell
                    (Windows Server 2012 R2, PS Version - 5.1.14409.1005)

                    "Set-mpioSetting -NewRetryInterval 1 "
                    returns the error
                    "Set-MPIOSetting : Cannot validate argument on parameter 'NewRetryInterval'. The 1 argument is less than the minimum allowed range of 3. Supply an argument that is greater than or equal to 3 and then try the command again."

                    The documentation at https://docs.microsoft.com/en-us/powershell/module/mpio/set-mpiosetting?view=win10-ps says that the default is 1 second, and we can use the GUI to be able to set the retry interval, but I want to be able to use powershell to automate the configuration of my…

                    4 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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                    • Powershell not interpreting spaces correctly

                      I am running a powershell script in the Post-Build event in Visual Studio (VS). Here is a simplified version of the command command

                      powershell -ExecutionPolicy remotesigned -File "%SampleDir%\update.ps1" "$(ProjectDir)" "$(TargetName)" "$(TargetExt)" "$(Configuration)"

                      I want you to understand that I have no control of these macro's $(ProjectDir) ... VS will fill these in.

                      To simplify things I've eliminated VS. Here is a script that simply echo's the input given to it. This will show the problem copy the below script to a file called echo-args.ps1
                      #===================================
                      "The number of parameters passed in is $($Args.Count)"
                      $i = 0
                      foreach ($arg in $Args)…

                      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 →
                      • PowerShell to select SSID

                        Many companies have several wifi ssids. You know, "Corp" "Guest" "Upstairs Lab"
                        Very very common.

                        How? How do you select one via PowerShell ?

                        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 →
                        • Add support for SSRS Mobile reports to Out-RsFolderContent

                          Out-RsfolderContent fails when exporting Mobile Reports because the 'TypeName' MobileReport is not covered in the function.

                          I added the following remedy to my system. may be nice for others.
                          I have not yet tested for PowerBI reports ... but neither have the people making these nice modules ...

                          if (($item.TypeName -eq 'MobileReport') ) {
                          $relativePath = $item.Path
                          if($RsFolder -ne "/") { $relativePath = Clear-Substring -string $relativePath -substring $RsFolder -position front }
                          $relativePath = $relativePath.Replace("/", "\")
                          $newFolder = $Destination + $relativePath
                          Write-Verbose "Creating folder $newFolder"
                          New-Item $newFolder -ItemType Directory -Force | Out-Null
                          Write-Verbose "Folder: $newFolder was created successfully."
                          }

                          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 →
                          • Powershell Windows defender bug

                            I found a bug with windows defender cmdlets!
                            Cmdlet:
                            set-mppreference -scanscheduletime
                            set-mppreference -scanschedulequickscantime

                            Providing an argument in format HH:mm works for values from 00:00 to 16:59 works as expected and when running get-mppreference the scanscheduletime and scanschedulequickscantime fields show the time requested.

                            Providing a time past 7pm (17:00) and then running get-mppreference shows the time in the format 2982615.22:16:00, which i believe means ~3 million days in the future.

                            windows 10 enterprise build 171314
                            windows server 2016 datacenter build 14393

                            Please let me know if you would like any further details!

                            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 →
                            • Enable configuration version tracking for compiled DSC configurations

                              As a part of infrastructure as code or using DSC in the deployment pipelines, it is desired that we be able to identify the version of the node configuration. With all configurations being put into a source / version control repository, it won't be difficult to promote the version number for a given configuration document. However, at this point in time, there is no way to specify the version of the configuration document itself anywhere. This makes it hard to determine or identify what version of the configuration is being used on a target node without using a 3rd party…

                              31 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  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
                              • fix help get-smbconnection -online

                                It references http://go.microsoft.com/fwlink/?LinkID=24194 which does a redirect to http://technet.microsoft.comlibrary/jj635713(v=wps.620).aspx which is missing the clash between com and library.

                                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 →
                                • How to compare current and next Iteration values of foreach loop in Powershell.

                                  Hi,I have a loop like below. In that, I want to compare next iteration value with current iteration value. If current value is not match with next value then I need to do some process. So I want to know like how to get the next Iteration value of a loop in powershell.
                                  $var = ('abc','abc','bcd','cdf','cdf')
                                  Foreach($i in $var){ 
                                  If($i -ne $nextiterationvalue) 
                                  {       do something  } 
                                  else  {     do something  }}

                                  Thanks,Dinesh

                                  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 →
                                  • CmdletsToExport publishing issue with large modules

                                    We (the AWS PowerShell Tools team) have hit an issue publishing the AWS modules to the gallery involving a limit of 4000 cmdlets in the CmdletsToExport manifest member. The gallery returns an error when we attempt to publish, which has forced us to revert to using "*-*" in the manifest, which gives a degraded user experience. I inspected the gallery publishing cmdlets and could see no sign of the limit there, so am assuming therefore that this was a gallery-side exception. The limit appears to be isolated to the CmdletsToExport manifest member as we're able to publish the module with…

                                    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

                                      2 comments  ·  PowerShell Gallery  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Import-PfxCertificate and relates commands don't exist on linux/macos powershell

                                      our .net core projects use powershell. The lack of these commands impedes our cross-platform activities.

                                      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 →
                                      • Unable to use PowerShell Transcription with Active Directory Administrative Console (ADAC)

                                        Setup group policy to enable PowerShell Transcripting. From a machine that has that policy applied, launch ADAC. The error "Cannot connect to any domain. Refresh or try again when connection is available." pops up and ADAC can't be used.

                                        https://github.com/PowerShell/PowerShell/issues/3021

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

                                          We’ll send you updates on this idea

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

                                            We’ll send you updates on this idea

                                            0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                                          • Don't see your idea?

                                          Feedback and Knowledge Base