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. DynamicParam should promote regular functions to advanced functions

    PowerShell promotes functions with [Parameter()] attributes to advanced functions, e.g.:

    function foo {

    param([Parameter()]$a)
    

    }

    gcm foo |% CmdletBinding

    True

    PowerShell should do a similar thing for functions with DynamicParam blocks since that construct only makes sense on cmdlets/advanced functions:

    function foo {

    dynamicparam { }
    

    }

    gcm foo |% CmdletBinding

    False, should be True

    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 →
  2. Invoke-WebRequest does not accept save all cookies in SessionVariable (bug)

    Invoke-WebRequest saves most, but not all, cookies that have been set in SessionVariable. Leading to a difficult to troubleshoot bug.

    Invoke-WebRequest should save all cookies that have been set by server response, just as a web browser would do. Otherwise, there is little point to having SessionVariable at all!

    1 vote
    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 →
  3. Invoke-WebRequest uses ID attribute of input element as field name in form fields collection (bug since 2013)

    This has been a bug on Microsoft Connect since at least 2013. It caused me hours of lost time today trying to track it down. Please fix, this is a very basic but frustrating bug.

    Instead of referring to the NAME attributes of input elements within a form the Fields collection stores the IDs of the attributes under the ‘key’ property.

    When you send the form back to the web server, the IDs of the elements get transferred instead of the form field NAMEs. This causes the request to be unrecognizable by the server.

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

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  4. BUG: WMF 5.0 RTM - removes PSSession registration of microsoft.powershell

    Hi.

    We deploy WMF 5.0 RTM to Windows 8.1 Industry Pro thru WSMan.

    windows 8.1 has build in PS version 4.0

    After installation of WMF 5.0 WSMan stop working due to there is only one session registered

    Get-PSSessionConfiguration returns only

    Name : microsoft.powershell.workflow
    PSVersion : 5.0
    StartupScript :
    RunAsUser :
    Permission : BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

    when I run Get-PSSessionConfiguration with PS 4.0 there are more providers

    Name : microsoft.powershell
    PSVersion : 3.0
    StartupScript :
    RunAsUser :
    Permission : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management

                 Users AccessAllowed
    

    Name : microsoft.powershell.workflow
    PSVersion : 3.0
    StartupScript :
    RunAsUser : …

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

    We’ll send you updates on this idea

    3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  5. Lastest Windows Insider Builds - Collection is read-only

    Attempting to import a module and run a PowerShell script is now resulting in an error about the collection is read-only.

    C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1'"

    Results in
    C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1 : Collection is read-only.

    At line:1 char:210
    + ... ller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunn .
    ..
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     + CategoryInfo          : NotSpecified: (:) [chocolateyScriptRunner.ps1] 
    
    , NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,chocolateyScriptR
    unner.ps1

    This is new and unexpected behavior. Here is the issue log for more information: https://github.com/chocolatey/choco/issues/659

    Here is the actual script in question - https://github.com/chocolatey/choco/blob/0.9.9.11/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 - it could be that we…

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

    We’ll send you updates on this idea

    investigating  ·  4 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  6. Start-Transcript Does Not Generate an Error on an Invalid Path

    On Windows Server 2012 R2, PSVersion 4.0, passing an invalid path to the Start-Transcript command does not generate an error. The cmdlet behaves as if the path exists, even producing the "Transcript started, output file is C:\fake\notreal.log" notification, while not actually generating any transcript file. Additionally, in my experience, performance slows considerably after this situation is encountered.

    On a Windows 7 system, Start-Transcript -path C:\notreal\no.log generates an error. On a Windows 10 system with PSV5 the nonexistant file will actually be created. Both of these are reasonable behaviors. Is there something I'm missing with PSV4 on WS2012R2 to get it…

    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 →
  7. Bug or ? doing comparison

    Not sure if this is a bug or a feature I haven’t heard about, but when working on datasets that are converted from strings containing the Scandinavian letters æ,ø,å my string comparison give the result below.

    PS D:>
    'ae' -eq 'æ'
    'aa' -eq 'å'
    'oe' -eq 'ø'

    True
    False
    False

    PS D:>

    Ideally I prefer when $True –eq $True working with comparison operators

    Name Value


    PSVersion 4.0

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

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  8. Add PowerShell accelerator for SuppressMessageAttribute

    Filed by rkeithhill on GitHub: https://github.com/PowerShell/PSScriptAnalyzer/issues/514

    "It is well within the norm for PowerShell to define accelerators for common types to make it easier for PowerShell scripters to specify an attribute like ValidateSet or ValidateNotNull and not have to remember the full typename System.Management.Automation.ValidateSetAttribute.

    Ditto for System.Diagnostics.CodeAnalysis.SuppressMessageAttribute. Please consider asking the PowerShell team to add the accelerator SuppressMessage for this type. It will make PowerShell scripts that need to use this attribute easier to write and read."

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →

    From the GitHub Issue:

    “I agree that it might be useful super forward-looking, but today this will only help in the case where:

    You’re running PS 5.1+, the module you’re running is using a SuppressMessageAttribute, and you don’t have Script Analyzer installed
    Given all that, this is firmly within the realm of “nice to have” for me, and I’m not sure anything nice to have can make it in PS 5.1 right now. I’m going to place it on UserVoice, though, as something we might want to do in the future for PowerShell."

  9. Get-Help -Parameter output is not correctly formatted when there is just one parameter.

    When a command (cmdlet/function) has just one parameter, Get-Help -Parameter returns a custom object, instead of a MamlCommandHelpInfo#parameter object.

    The object is unformatted an the output appears to be broken. This is not related to comment-based help or XML help format.

    Compare: Get-Help Get-Command -Parameter CommandType
    To: Get-Help Get-Verb -Parameter Verb

    PS C:\ps-test> Get-Help Get-Verb -Parameter Verb

    description : {@{Text=Gets only the specified verbs. Enter the
    defaultValue : All verbs

    parameterValue : string[]

    name : Verb

    type : @{name=string[]; uri=}

    required : false

    variableLength : true

    globbing : true

    pipelineInput : true (ByValue)

    position : 1

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

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  10. Bug in variable assignment parser

    Bug found in the use of a literal "(" as input into a variable assignment.

    $test=$(print "<any string>(<any string>")

    This returns an error(Message listed below) :
    a) Putting a space before or after the equals sign is a work around this problem.
    b) This error only shows up in the ISE , but creates a continue line considering it is incomplete in the regular powershell prompt

    $(subexpression) is missing the closing ')'.

    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    
    + FullyQualifiedErrorId : IncompleteDollarSubexpressionReference

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

    We’ll send you updates on this idea

    6 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  11. Add-Type -AssemblyName Microsoft.SqlServer.Smo Doesn't Work

    Add-Type -AssemblyName Microsoft.SqlServer.Smo only works if you have an older version of SQL Server installed.

    Add-Type : Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
    PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

    Please update the version table to support all versions of SQL Server, including 2016, if possible.

    4 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 →
  12. using module statement must support ModuleSpecification syntax

    In order to work in PowerShell 5 with multiple versions of a module installed side-by-side, the using module statement needs to support the same syntax as #requires -module

    The new "using module <ModuleName>" syntax for importing classes from modules for use in scripts is broken when there's more than one version of a module installed. Currently having multiple versions of a module is COMPLETELY BROKEN. We don't just get the newest version, instead we get this error:

    ```


    • using module Configuration

    • ~~~~~~~~~~~~~~~~~~~~~~~~~~
      Multiple versions of the module 'Configuration' were found.
      You can run 'Get-Module -ListAvailable -FullyQualifiedName Configuration'
      to see available…
    7 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  13. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  14. Bug: WMF 5 Production Preview on Windows Server 2008R2 breaks sysprep

    I just ran into the exact problem described in this ServerFault article:
    http://serverfault.com/questions/749441/sysprep-fails-on-windows-2008-r2-after-wmf5-installation

    After installing WMF 5 Production Preview, sysprep fails out, complaining that a registry key it is trying to delete doesn't exist.

    The workaround in that link works. Adding:

    REGEDIT4
    [HKEYLOCALMACHINE\SOFTWARE\Microsoft\Windows\StreamProvider] "LastFullPayloadTime"=dword:00000000

    allows sysprep to complete properly.

    This appears to be related to the sysprep failure caused by WMF5 on Server 2012. The changes in Generalize.xml in that bug include the registry delete command implicated in this bug.

    http://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11518368-bug-wmf-5-production-preview-on-windows-server-20

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

    We’ll send you updates on this idea

    8 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. Get-Module -List gives no output for UNC paths

    Get-Module -ListAvailable gives no output when used with the -Name parameter and UNC paths. In my limited testing this appears to only affect Windows Server SKUs.

    Repro Steps:
    1. Create a script module on a UNC path (name it test.psm1)
    2. From a powershell window run:

     Get-Module -ListAvailable -Name \\path\to\test.psm1
    

    Expected Results:
    Get-Module returns the ModuleInfoGrouping object for the module

    Actual Restuls:
    Get-Module returns nothing

    Additional info:
    $PSVersionTable

    Name Value


    PSVersion 4.0
    WSManStackVersion 3.0
    SerializationVersion 1.1.0.1
    CLRVersion 4.0.30319.42000
    BuildVersion 6.3.9600.17400
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
    PSRemotingProtocolVersion 2.2

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  16. different chinese string eq return true

    different chinese string eq return true

    There are some different chinese string eq return true
    In this chinese letter, word of strokes like,but utf8 code not same,utf16 code not same.

    【bug with powershell version】
    powershell 2.0 with windows7:no this bug,tested.
    powershell 3.0 :unknown
    powershell 4.0 :yes
    powershell 5.0 with windows10 10586 :yes tested.
    notice:tested on powershell.exe,not powershell ise.

    【test code】
    notice:ps1 file save as utf8 or unicode,bug same.

    [int64][char]'郎'
    [int64][char]'郎'
    '郎' -eq '郎'

    [int64][char]'凉'
    [int64][char]'凉'
    '凉' -eq '凉'

    [int64][char]'隣'
    [int64][char]'隣'
    '隣' -eq '隣'

    [int64][char]'秊'
    [int64][char]'秊'
    '秊' -eq '秊'

    [int64][char]'裏'
    [int64][char]'裏'
    '裏' -eq '裏'

    【reason】
    unknown

    【reporter】
    By the chinese powershell…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  17. JSON file format for Type and Format files

    The XML files can become quite difficult to work with especially with just a text editor. Most of the file is made up of tags and almost no actual functional data. JSON would be easier to work with and continue to march away from XML configuration files.

    6 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 →
  18. BUG : [Class] PSReference is not working on a static property

    I would like to implement a simple Id Counter but I found a bug

    Step to reproduce :
    PS >
    class Class1 {

     static [int] $IdCount = 0
    
    [int] $Id = 0
    Class1() {
    $this.Id = [System.Threading.Interlocked]::Increment([ref][Class1]::IdCount)
    }

    }
    PS > Class1::new() | Out-Null
    PS > Class1::IdCount
    0

    Expected :

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. Please restore legacy CMD.EXE function-key functionality, e.g. F1 and F2

    In the legacy cmd.exe shell, a number of functions keys provided command recall functionality. For example, F1 would restore a character from the previous command one character at a time. Another example and the reason I'm typing this is F2 which allowed you to hit F2 + <some other character> and it would recall the previous command up to the first occurrence of that character, typically a space.

    Please re-instate this functionality or I shall spend the rest of my days designing products that use horrific noun prefixes that you will loathe. :-)

    /Dean Wells

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  20. WMF 5 Manage Constrained Mode

    I'd appreciate having a group policy option to manage Constrained Mode for PowerShell (Except for undefined, all options cumulative):
    - Undefined (Use Session Configuration)
    - Local
    - Local nonelevated
    - Local elevated
    - Local script
    - Local Interactive
    - Remote

    To replace the headache that is the current security configuration that triggers once you use Applocker / RSP

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

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base