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. 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  ·  5 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  2. Improve the speed of Get-EventLog

    As you describe here:
    https://blogs.technet.microsoft.com/heyscriptingguy/2011/03/08/how-to-improve-the-performance-of-a-powershell-event-log-query/
    The Get-EventLog command is slow. Using Get-WinEvent is much faster.The Get-EventLog is still easier to use though.
    Maybe Get-EventLog could be refactored to use Get-WinEvent

    6 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. 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 →
  4. Write-Progress output is not displayed properly when multiple ISE tabs are open in PowerShell 3.0

    Votes from Connect: 11

    Original Date Submitted: 2/6/2013 3:35:55 AM

    Description:

    Contact Information
    Handle: DougBB
    Site Name: PowerShell
    Feedback ID: 778597


    Frequency: Always Happens
    Regression: No, this is new to the most recent version

    Problem Description:
    Under certain circumstances, when Write-Progress is used in Windows PowerShell ISE and a new tab is opened, the Write-Progress output does not display properly. Closing tabs makes it appear.

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

    Repro Steps:
    1. Run "powershell_ise.exe -noprofile"
    2. Paste the following code in the script pane:

    $i = 1..100
    
    34 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    7 comments  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  5. Get-PSSessionCapability returns capabilities even when the speficied user doesn't have permissions to connect to the session

    The documentation on Get-PSSessionCapability states it returns information (capabilities) on the session configuration the specified username has on it, but it also returns it for a SessionConfiguration (created with a pssc file) when it wasn't created with a RoleDefinition, no matter if the specified user can or cannot access it.
    I would expect it not to return any information for that SessionConfiguration, or have a property that indicates the specified doesn't have the required permissions (invoke / fullcontrol).

    3 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 →
  6. Suggestion: Allow explicit hexadecimal casts to [UInt32]

    I find it frustrating that there is no simple method of casting a 32-bit number with its high order bit set. For example consider the following number - 0x80000001:

    [UInt32] 0x80000001 <- throws an exception because it is implicitly converted to an Int32 which then cannot be converted to a UInt32.

    Various workarounds:
    * [UInt32] '0x80000001' <- String conversion. This operation is unnecessarily expensive.
    * [UInt32] 0x80000001L <- Downcast an Int64 to a UInt32.
    * [UInt32] 0x80000001 -band [UInt32]::MaxValue <- Perform bit math to force the conversion while preserving the bits.

    Proposed fix:

    As Jason Shirk suggested, it would probably…

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

    We’ll send you updates on this idea

    survey  ·  3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  7. allow DSC nodes to download meta configuration

    when wmf4 initially launched, you could place meta.mof files into the pull server along side the default mof and both would be downloaded by the node and applied. This was rather ideal, as it meant I could create standard LCM configurations, and easily update/enforce them.

    For some reason, this seems to no longer work in WMF5.0. This should be returned. Anyone who's had to edit the settings of hundreds (thousands?) of agents should understand it's way easier to tweak one property.

    Real world example: ask anyone who's ever had to reconfigure the the SCCM agent cache. It's a needlessly complex…

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

    We’ll send you updates on this idea

    5 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
    survey  ·  Mark Gray responded

    Justin,

    Thanks for you feedback! I What types of things do you find yourself needing to manage in the meta-config after initial deployment? This is not to take away from the need for this, I want to better understand how you and other customers are / want to use it.

    Regards,

    MarkG

  8. ValidateSet doesn't accept constants like it says it does

    When running the below script on Windows 10 PowerShell 5.0.10586.494, it crashes with an error stating that the argument isn't a constant even though it is:

    Set-Variable -Option Constant ConstantVariable 'c'
    Set-Variable -Option Constant ConstantArrayVariable @('c')

    function Test-ValidateSet {

    param(
    
    [ValidateSet($ConstantVariable)]
    $p1,

    [ValidateSet($ConstantArrayVariable)]
    $p2
    )

    }

    At C:\tmp\Test-ValidateSet.ps1:7 char:22
    + [ValidateSet($ConstantVariable)]
    + ~~~~~~~~~~~~~~~~~
    Attribute argument must be a constant or a script block.
    At C:\tmp\Test-ValidateSet.ps1:10 char:22
    + [ValidateSet($ConstantArrayVariable)]
    + ~~~~~~~~~~~~~~~~~~~~~~
    Attribute argument must be a constant or a script block.

    + CategoryInfo          : ParserError: (:) [], ParseException
    
    + FullyQualifiedErrorId : ParameterAttributeArgumentNeedsToBeConstantOrScriptBlock

    This is an important feature for me because I…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  9. PS 5.0 Bug: Transcript stops after restarting a remote computer using ‘Restart-Computer’ with '-Wait' parameter.

    PS 5.0 Bug: Transcript stops after restarting a remote computer using ‘Restart-Computer’ with '-Wait' parameter.

    Example script:
    Start-Transcript c:\test.log
    $computername = "Fred"
    $credential = (get-credential "domain\user")

    Restart the remote computer.

    Restart-Computer -ComputerName $computername -Credential $credential -protocol WsMan -WsmanAuthentication Default -force -wait -for powershell -erroraction stop
    Stop-Transcript

    My tests were performed in the following environment - the source computer is Windows 7 SP1 with PowerShell 5.0, the target is Windows 7 SP1 with PowerShell 4.0.

    Upon completion of the reboot, the transcription is stopped. This is recorded in the transcript log file as “Windows PowerShell transcript end”. This results in 'Stop-Transcript'…

    5 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  10. Register-ArgumentCompleter is not documented

    The cmdlet Register-ArgumentCompleter is not documented.

    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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  11. Cmdlet for getting list of Installed Software via Registry instead of win32_product.

    Would be great to have a builtin Cmdlet for getting list of Installed Software via Registry instead of win32_product.

    Why win32product is bad:
    https://sdmsoftware.com/group-policy-blog/wmi/why-win32
    product-is-bad-news/

    It would be faster, and would not trigger validation of all installed packages.

    Would use the following regkeys to return list of software (name, version, installDate) on local or remote machine (requires Remote Registry to be enabled on remote machine).

    HKLM:\Software\microsoft\windows\currentVersion\Uninstall
    HKLM:\Software\wow6432node\microsoft\windows\currentVersion\Uninstall

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

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →

    Will watch for folks to add their voices to this.
    In the meantime, if there is someone who wants to publish a user-contributed item to the PowerShell Gallery that does this, it would certainly be welcomed.

  12. new-modulemanifest doesn't support ExternalModuleDependencies

    In order to register external module dependencies (dependencies living in another repository), the name has to be registered in a string array property within the PSData Hashtable property in the PrivateData section in the psd1 manifest like so for registering module 'psFtp':

    PrivateData = @{
    PSData = @{

    ExternalModuleDependencies

    ExternalModuleDependencies = @('psFtp')
    }
    } # End of PrivateData hashtable

    However, the new-modulemanifest doesn't have an -ExternalModuleDepencies parameter, nor is it possible to register externalmoduledependencies like so:

    -PrivateData @{ PSData = @{ ExternalModuleDependencies = @('psFtp') } }

    Which from a client perspective of the the existing new-modulemanifest api, would be an…

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

    We’ll send you updates on this idea

    1 comment  ·  Package Management  ·  Flag idea as inappropriate…  ·  Admin →

    Thanks for the comment. We will be monitoring this to see how many users are impacted by / recommending it.

  13. new parameter -markdown for Format-Table

    Example:

    $Get-Process | select -First 5 | ft -au

    Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName


    716     47 32832 43396   587          1764 AdminManagerClient
    
    257 34 3432 9352 84 1128 AgentService
    495 78 15700 28528 154 3744 AppVClient
    244 35 60952 41796 692 0.56 5416 AppVStreamingUX
    591 18 17280 22992 108 1,751.98 4672 audiodg

    $Get-Process | select -First 5 | ft -markdown

    |Handles|NPM(K)|PM(K)|WS(K)|VM(M)| CPU(s)| Id|ProcessName |
    |-------|------|-----|-----|-----|--------|----|------------------|
    | 716| 47|32832|43396| 587| |1764|AdminManagerClient|
    | 257| 34| 3432| 9352| 84| |1128|AgentService |
    | 495| 78|15700|28528| 154| |3744|AppVClient |
    | 244| 35|60952|41796| 692| 0.56|5416|AppVStreamingUX |
    | 591| 18|17280|22992| 108|1,751.98|4672|audiodg |

    This could be…

    5 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  14. Bug: Move-Item

    Noticed a bug with the "Move-Item" cmdlet.

    Example:
    The source folder and destination folder have different permissions sets.

    $src = "C:\Path\To\Source&quot;
    $dest = "D:\Path\To\Dest"

    ForEach($file in $src)
    {

      Move-Item $($file.fullname) -destination $dest
    

    }

    Using this block of code to move files from one folder to another will result in the files not inheriting permissions from the destination folder.

    The files that were moved retain the permissions from the source folder.

    This doesn't happen with Copy-Item or when you drag / drop files.

    Workaround I found is to add "icacls $dest /T RESET" to the end of the script.

    7 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. Have the Find window to remember the last search string

    Have the Find window to remember the last search string

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

    We’ll send you updates on this idea

    survey  ·  3 comments  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  16. Make ISE look like a Windows 10 app

    ISE currently has shiny toolbars, detailed colourful icons, and old-style non-high res (ie, 2 inches wide) launch bitmap that covers other apps while ISE launches.

    Modern Windows tools have less distracting bling. Powershell should be consistent with other MS apps like Visual Studio or Word, with a minimal UI so we can focus on the content in the terminal.

    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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  17. "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  ·  0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  18. Generate DSC from existing servers

    For those of us with heavily-configured snowflake servers, it would great if it were possible to generate DSC files from existing builds. This may not be possible in all areas, but perhaps a subset of areas could be supported, with IIS 7.0+ at the top of the list.

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

    We’ll send you updates on this idea

    survey  ·  3 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  19. Properly handle multi-line commands when read from stdin (and stdin is not a tty)

    If Powershell is reading scripts from stdin, when executed using "Powershell -Command - ", then it exits as soon as it sees a multi-line statement. This can be solved by adding an extra newline, but this should not be necessary if stdin is not a tty, and definitely not if "-NonInteractive" is specified.
    Further details and investigation here: http://stackoverflow.com/questions/37417613

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  20. pipelinevariable vs outputvariable processing bug

    PS C:\Users\Administrator\Downloads\Lync\Lync> $outputtest = $null

    PS C:\Users\Administrator\Downloads\Lync\Lync> get-process -PipelineVariable pipelinetest -OutVariable outputtest | ? {$outputtest.name -like "vmwp"}

    Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName


    617      31    48096      27688   170   371.03    328 vmwp                                                                                                                                                
    
    535 57 39700 17712 135 251.22 2124 vmwp
    541 57 9584 18932 135 234.36 2644 vmwp
    85 7 760 3736 20 0.05 592 wininit
    161 8 1488 6564 66 0.25 624 winlogon
    227 11 10744 14144 56 2.45 1200 WmiPrvSE
    238 15 6072 11876 70 0.64 3592 WmiPrvSE

    PS C:\Users\Administrator\Downloads\Lync\Lync> get-process -PipelineVariable pipelinetest -OutVariable outputtest | ? {$pipelinetest.name -like "vmwp"}

    Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id…

    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 →
  • Don't see your idea?

Feedback and Knowledge Base