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.
  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Add A "Start In" Directory for Enter-PSSession

    By default, we are placed into Documents (at least I am), then have to change directories. It would be nice to be able to specify a directory we'd like to start in using Enter-PSSession.

    19 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  WinRM  ·  Flag idea as inappropriate…  ·  Admin →
  2. "Select-Object -Unique" and "Group-Object" should not have quadratic runtime

    De-duplicating a collection, or aggregating similar items in a collection, can be done in linear time via hash sets or hash tables, respectively.

    "Select-Object -unique" and "Group-Object", however, both use O(n^2) algorithms that rely only on equality, never leveraging hashing. It's literally faster (by a lot) to use "Sort-Object -Unique", which additionally does sorting.

    Blog post at http://latkin.org/blog/2016/08/02/curious-behavior-when-de-duplicating-a-collection-in-powershell/ has more explanation.

    It was suggested by Bruce P on Twitter that I open this bug: https://twitter.com/BrucePayette/status/760532657293832192

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  3. Windows Server as a REST API

    Delegating access to Windows Server functions (e.g., create a DHCP reservation, modify a DNS record, provision a share, etc.) in a heterogeneous, modern, self-service environment is greatly hindered by available protocols. While RPC, CIM, psremoting/wsman/soap, et al. are technically open, they are far enough from modern mainstream app heterogeneous ease of use that they are practically Windows only.
    Windows should provide a facility to easily expose Windows functions as simple REST-ish APIs accessible to any calling platform. JEA makes a great engine for executing delegated functions, so I would imagine using JEA or similar as the execution context, but with…

    6 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  2 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  4. SupportsShouldProcess adds help for cmdlets, but not functions

    When you add the SupportsShouldProcess property (CmdletCommonMetadata) to a C# cmdlet, it adds the WhatIf/Confirm parameters and their standard help descriptions.

    But, when you use the SupportsShouldProcess parameter of the
    CmdletBinding attribute in an advanced function, it adds the WhatIf and Confirm parameters, but it doesn't add the standard help descriptions for these parameters, as designed.

    Unless function authors add the help explicitly it doesn't exist, and then authors write their own help, so we end up with a multiplicity of descriptions of the same thing, which can be confusing to users. That's why we created the standard help.

    And,…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  5. RunspacePool handle and memory leaks (no leaks in v2)

    Invoke the below script. In the infinite loop it creates runspace pools and
    uses them for invoking jobs. In the end of each iteration script outputs
    the process handle count and private memory size.

    In PS v5.1 the handle count and memory size constantly increase.
    In PS v2.0 these leaks are not observed.

    -----8<-----

    $sw = [System.Diagnostics.Stopwatch]::StartNew()
    
    $count = 0
    for() {
    $pool = [RunspaceFactory]::CreateRunspacePool(1, 2)
    $pool.Open()

    $ps1 = [PowerShell]::Create()
    $ps1.RunspacePool = $pool
    $job1 = $ps1.AddScript(&#39;&quot;job1 $(Get-Date)&quot;&#39;).BeginInvoke()

    $null = $job1.AsyncWaitHandle.WaitOne()
    $ps1.EndInvoke($job1)

    $ps1.Dispose()
    $pool.Close()

    ++$count
    $p = Get-Process -Id $PID
    &quot;$($p.HandleCount) $($p.PrivateMemorySize64 / 1mb) $($count / $sw.Elapsed.TotalSeconds)&quot;
    }

    -----8<-----

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  6. WMF5.1 Incorrect code completion of Set-StrictMode -v

    In a PowerShell console type

    Set-StrictMode -v

    and press Tab repeatedly.
    As a result code completion iterates through two results:
    -Version
    -v

    In previous versions, I believe, two results were:
    -Version
    -Verbose

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  7. Make Cmdlets pick up app.config, especially binding redirects

    I can't believe this hasn't been resolved already.

    Surely adding assemblies to the GAC and mofiying machine.config is not a great solution.

    http://stackoverflow.com/questions/18542812/powershell-cmdlet-missing-assembly-google-api

    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  8. WMF5.1 - Get-ComputerInfo unable to find entry point GetFirmwareType

    Running the new Get-ComputerInfo returns the following error
    C:&gt; Get-ComputerInfo
    Get-ComputerInfo : Unable to find an entry point named 'GetFirmwareType' in DLL 'kernel32.dll'.

    This is on a XenDesktop VM hosted on VMWare, so I guess it's due to the desktop being virtualised. OS is Win7x64

    14 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  7 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  9. Limiting the new User PSDrive in JEA in WMF 5.1

    Now that you can set a user PSdrive in JEA to to allow copying files, would be nice to have the ability to include to exclude files allows to be copied to the drive and from the drive as part of the configuration script to create the endpoints

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  4 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  10. [Bug] Castle's DynamicProxy breaks property indexers

    This blog post explains the issue is greater detail - https://matt.kotsenas.com/posts/powershell-dynamicproxy-indexers

    Setup:
    1. Create a C# class with an interface
    2. On that interface add a property indexer (and implement it in the class)
    3. Use Castle's DynamicProxy generator to create a proxy for that object

    Expected Results:
    - The proxy behaves like the regular object and the indexer works (e.g. $myObject['foo']

    Actual Results:
    - The proxy's indexer does not exist (e.g. $myObject['foo'] returns null)
    - The underlying getItem() method exists and works (e.g. $myObject.getItem('foo) returns the expected value)

    Here's a full implementation with sample code:

    ```
    $assemblies…

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  11. Microsoft Downloads Provider for PackageManagement

    It might be helpful to have a provider for Microsoft downloads.

    For example, Message Analyzer, Azure AD Connect, and a variety of other software is available from Microsoft, but require manual hoops, or custom scripting to install via PowerShell.

    Use case: Most automation and management tasks that involve software available from Microsoft downloads...

    I do see that this might be tough, given that some of these downloads may be standalone files (executables, docs, etc.), some may be MSIs, etc.

    Cheers!

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Package Management  ·  Flag idea as inappropriate…  ·  Admin →

    Have to investigate this a bit. I believe there are several different download/install approaches. Question back to you: what would be the top 3-5 download areas you would want to see?

  12. Workflow: activities in nested workflows invoked from ForEach -Parallel execute on wrong machines

    Consider a workflow which is given a list of servers. The workflow contains a ForEach -Parallel block, which invokes a nested workflow tor each server from the list (using -PSComputerName). In this scenario, activities from some of the nested workflow instances sometimes execute on different servers than they should.

    Repro:
    workflow Reproduce-ForEachParallelRemotingBugChild
    {

    Param ([string] $s)
    
    Write-Verbose &quot;(s=$s) PSComputerName $PSComputerName&quot;
    Write-Verbose &quot;(s=$s) sleeping&quot;
    Start-Sleep -Seconds 1
    Write-Verbose &quot;(s=$s) getting item&quot;
    $x = Get-Item -Path C:\
    Write-Verbose &quot;(s=$s) $($x.Name) $($x.PSComputerName)&quot;
    Write-Verbose &quot;(s=$s) PSComputerName $PSComputerName&quot; # this is OK (PSComputerName does not get corrupted)
    if ($x.PSComputerName -ne $s)
    {
    Write-Error &quot;BUG! This
    4 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  13. Tee-Object doesn't work in scripts/functions that support ShouldProcess

    Overview

    When Tee-Object is used in a function/script that supports ShouldProcess, it doesn't work. It appears that internally, Tee-Object uses Set-Variable, which does support ShouldProcess. Tee-Object itself doesn't support ShouldProcess, so you can't change the behavior with a -WhatIf:$false parameter.

    Steps to Reproduce

    function Invoke-TeeObject
    
    {
    [CmdletBinding(SupportsShouldProcess=$true)]
    param(
    )

    Get-ChildItem -Path $env:temp *.fubar | Tee-Object -Variable &#39;tempFilesFound&#39; | Remove-Item -Recurse -Force

    Write-Output (&#39;Removed {0} temporary text files.&#39; -f $tempFilesFound.Count)
    }

    &#39;&#39; | Set-Content -Path (Join-Path -Path $env:Temp -ChildPath &#39;tee-object.fubar&#39;)
    Invoke-TeeObject -WhatIf

    Results in this output:

    What if: Performing the operation &quot;Remove File&quot; on target &quot;C:\Users\ajensen\AppData\Local\Temp\tee-object.fubar&quot;.
    
    What if: Performing the operation
    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  14. Document two types of terminating errors

    PowerShell help describes errors as non-terminating and terminating.
    But it does not tell that there are two types of terminating errors.

    For example, "true terminating errors" are produced by throw in scripts.
    They terminate the current script AND the calling script.

    Other terminating errors terminate only the current pipeline and DO NOT
    terminate the calling script unless its $ErrorActionPreference='Stop'
    or there is try/catch/finally or trap somewhere in the call stack.

    Just one example. A missing command is such a semi-terminating error (help about_trap).
    More: https://github.com/nightroman/PowerShellTraps/tree/master/Basic/Errors-of-unusual-type

    In the following command Get-Date is invoked after the error and the exit code is…

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. CheckPoint-Workflow points to non-existent help for how to checkpoint

    At the bottom, this URL goes to a "This topic is no longer available":

    SEE ALSO

    How to Add Checkpoints to a Workflow (<a rel="nofollow noreferrer" href="http://go.microsoft.com/fwlink/?LinkId=261993">http://go.microsoft.com/fwlink/?LinkId=261993</a>)
    

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  16. about_Language_Keywords is missing 4.0-5.0 keywords

    aboutLanguageKeywords for PowerShell 5.0 (https://technet.microsoft.com/library/hh847744.aspx) is missing all of the new keywords for PowerShell 4.0 and 5.0, including critical keywords, such as Configuration, Class, and Enum.

    18 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  17. Show Module size in properties on PowerShellGallery.com

    I would like to know how big a module is before downloading it.

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Gallery  ·  Flag idea as inappropriate…  ·  Admin →
  18. PowerShellGet and redirected MyDocs

    When using -Scope CurrentUser with the Install-* cmdlets from PowerShellGet it looks at [Environment]::GetFolderPath("MyDocuments") to determine where to install the modules/scripts/etc.
    If using Folder Redirection for My Documents, this is likely to be a network path which causes some issues such as performance (kills tab completion), as well as some potential issues with binary modules.

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    4 comments  ·  Package Management  ·  Flag idea as inappropriate…  ·  Admin →

    Understand the problem now, which is based on loading the DLL from a redirected share.
    Moving to a Survey item to gauge priority.

    Thank you -

  19. ps5.0bug:please remove count length property from number object!

    ps5.0bug:please remove count length property from number object!

    Normal logic:
    There is no "count" and "length" attribute in the numeric type.

    【Cause of the bug】
    in my guess:
    powershell 1.0 developer:
    wrong add property "count" and "length" to number object,then make them equal to null.

    powershell 3.0 developer:
    then make them equal to 1.

    Joey Aiello [MSFT] (Program Manager, Windows Server):
    In PowerShell v3 the "Length" property was added to ALL objects. This was wrong.
    https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11087970-ps3-length-property-added-to-all-objects-should-be

    【bug with powershell version】
    powershell 5.0 in win10 10586.494: yes,tested.

    【test code in win10】
    $a = 1234777
    $a.gettype().fullname #system.int32
    $a.length #return 1
    $a.lengtha #return…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  6 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  20. Add eval alias to Invoke-Expression to PowerShell core

    Adding an eval alias to the PowerShell core, pointing to the Invoke-Expression command, would help to improve compatibility with Bash scripts on Linux.

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

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

Feedback and Knowledge Base