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. Get-Help cmdlet should skip error and continue updating help doc.

    I know that there are many cmdlets help documentation not completed yet. But, it's a pain when trying to use the "Update-help" cmdlet and see it error-out due to an unfinished module help.

    I think it should be a good idea to display the error and continue (or try) update the rest of our installed module(s).

    In my case, I'm getting an error update the help on the new SQLServer module. But this is now completing the update for the rest of my existing module.

    If this update is done alphabetically then the update is stopping at the SQLServer module…

    6 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 →
  2. Code completion pollutes $Error

    PowerShell v5

    Start a clean session:
    PowerShell -NoProfile

    Type the following characters:
    [cmd=

    and press Tab. The code is not completed, this is fine.

    But the global error collection $Error contains an error:
    The specified wildcard character pattern is not valid: [cmd=*

    Code completion should avoid such noise errors. They distract and may make an
    illusion that some user code produces them. Time may be lost on finding the
    actual culprit.

    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 →
  3. Bug: [string]::Equals and -eq inconsistency when strings contain "`0"

    "`0xyz" -eq 'xyz' # True - NUL character is ignored
    same with

    "`0" -eq '' # True

    2 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. Add support for TLS 1.2 (Invoke-WebRequest, Invoke-RestMethod)

    Invoke-WebRequest and Invoke-RestMethod commands only support TLS 1.0 protocol. We need to have a native support for newer TLS (1.2) versions for modern web interfaces.

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

    We’ll send you updates on this idea

    6 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
    survey  ·  Zachary Alexander responded

    changing to Survey based on Joonas’ comment below – request is to have a flag to force TLS 1.2.

  5. ConvertTo-Json doesn't serialize simple objects properly

    Given a simple array which has been boxed in a PSObject

    [PSObject]$o = @(@(Foo,1),@(Bar,2))

    Calling ConvertTo-Json returns a weird pointless wrapper around it:

    convertto-json $o
    {

    "value":  [
    
    [
    "Foo",
    1
    ],
    [
    "Bar",
    2
    ]
    ],
    "Count": 2

    }

    Which completely breaks round-trip support

    ConvertFrom-Json (Convertto-Json $o)

    value Count


    {Foo 1, Bar 2} 2

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

    We’ll send you updates on this idea

    survey  ·  14 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  6. ConvertFrom-Csv has undocumented partial comment support

    When multiple strings are fed into ConvertFrom-Csv, it will ignore lines prefixed with a '#' character. When fed a single string, it retains those lines. Unless it is the first line, in which case it is ignored either way. This behavior happens whether sent through the pipeline or provided to the -InputObject parameter.

    The workaround is to use double quotes around the item with the leading '#'.

    I guess this comes from handling the optional type information. The check for the "#TYPE" seems to happen only once with the single string, and every time when given multiple strings.

    Choose either…

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  7. [Bug] New-PSSession returns null when executed from a non-console session

    Hi,

    We're seeing an issue where New-PSSession returns null when executed from a non-console session. Specifically, we have a top-level script that gets executed from Cake (http://cakebuild.net/) and Cake.Powershell (https://github.com/SharpeRAD/Cake.Powershell) within a TeamCity build agent.

    The top-level script is structured similar to:
    Set-StrictMode -Version Latest

    $Error.Clear()
    $ErrorActionPreference = "Stop"

    try
    {

    $remoteSession = New-PSSession `
    
    -ComputerName $FullyQualifiedDNSName `
    -UseSSL `
    -SessionOption (New-PsSessionOption -SkipCACheck -SkipCNCheck) `
    -Port 5986 `
    -Credential $credentials `
    -WarningAction Continue

    }
    catch
    {

    Write-Warning -Message ($_ | ConvertTo-CakeFormattedError)
    
    throw

    }

    When executed from Cake/Cake.Powershell via TeamCity, $remoteSession ends up being null. However, 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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  8. [BUG] Group-Object with -AsHashTable and custom expressions

    There seems to be a bug in Group-Object when using the -AsHashTable switch and where any custom expression that returns a string is used. The hashtable is created, can be enumerated, but trying to get an entry from it using the indexer doesn't work. This seems to be the case exclusively when the expression returns a string.

    Consider the following:

    PS C:\Windows> $Items = Get-ChildItem | Group-Object -Property Extension -AsHashTable
    
    PS C:\Windows> $Items

    Name Value
    ---- -----
    .DMP {MEMORY.DMP}
    .bin {mib.bin}
    .xml {Enterprise.xml, Starter.xml}
    .NET {Microsoft.NET}
    .INI {HPMProp.INI, init.ini, msdfmap.ini, SMSCFG.INI...}
    .dat {bootstat.dat, ConnectionProfiles.dat}
    .dll {ISMIF32.dll, twain.dll, twain_32.dll}
    .exe {bfsvc.exe,…

    5 votes
    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 →
  9. 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 →
  10. PowerShell SDK is missing XML comment files

    It's really awesome that there are SDK assemblies in NuGet for PowerShell now, but...

    We need xml documentation. It's traditional to include the XML file for each assembly you ship in NuGet, and none of them were included in any of the packages...

    P.S. Did you really mean to release those under MIT?

    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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  11. Add parameters to Select-String for matching all lines from (StartPattern) to (EndPattern)

    To get blocks of text from a file, e.g. config sections from an opening tag to a closing line. All log lines for a reboot, starting with "System Booting at" and ending with "Boot Finished".

    Example:

    Select-String -Beginning '^FastEthernet' -Ending '^!'

    Output: Multiple arrays of lines taken from a Cisco switch config, each array containing the lines for a FastEthernet interface configuration.

    Example:

    Select-String -Between '^User: .*'

    Output: Arrays of lines from one "User: name" line to the next, to isolate blocks of settings for each user. Probably including the first match and excluding the second match, in the same…

    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 →
  12. Evaluate target enumeration names to distinguish ambiguous overloads when implicitly casting parameters

    This line works, because PowerShell correctly guesses that I want to use the constructor which takes a String, a FileMode enum, a FileAccess enum, and a FileShare enum, and implicitly casts the last three strings to the appropriate enumeration.

    $Input = New-Object System.IO.FileStream $GZFilePath, 'Open', 'Read', 'Read'

    This line fails, because PowerShell does not know if I want the constructor which takes a String and a CompressionLevel enum, or a String and a CompressionMode enum.

    $Stream = New-Object System.IO.Compression.GzipStream $Input, 'Decompress'

    But PowerShell could distinguish between the two by checking if the string is a valid name in one and…

    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 →
  13. Bug: Console output appears out of order

    In 5.0, objects returned from a script will appear in the console only after the script has completely finished if no formatting data is defined for that object type.

    Example:

    Write-Warning "Before"
    
    Get-Service E* | select Status, Name, DisplayName
    Write-Warning "After"

    Output:

    WARNING: Before
    
    

    WARNING: After
    Status Name DisplayName
    ------ ---- -----------
    Stopped EapHost Extensible Authentication Protocol
    Running EFS Encrypting File System (EFS)
    Running eventlog Windows Event Log
    Running EventSystem COM+ Event System

    Details
    - This did not happen before PowerShell 5.0
    - This happens both in the PowerShell console and ISE
    - The issue affects all objects that have…

    16 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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  14. Job cmdlets fail with UTF-8 codepage

    Powershell jobs (eg, Start-Job, Wait-Job, Receive-Job) fail when Powershell's codepage is set to UTF8.

    Simple reproduction on Server 2012R2 w/ PS5:
    from cmd.exe, set the parent process codepage and start powershell with:

    chcp 65001
    powershell

    from the powershell that just started:
    $job = Start-Job -ScriptBlock { Write-Output yo }
    Receive-Job $job -Wait

    The Receive-Job call will fail with: "
    [localhost] The background process reported an error with the following message: Cannot process an element with node type "Text". Only Element and EndElement node types are supported. at
    System.Management.Automation.Remoting.OutOfProcessUtils.ProcesData(String data, DataProcessingDelegates callbacks).

    + CategoryInfo          : OpenError: (localhost:String) [], PSRemotingTransportException
    
    + FullyQualifiedErrorId
    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  4 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. ise color bug:inlinescript

    【Cause of the bug】
    "inlinescript" is a keyword, but color wrong in ise,color as same as a command.

    【bug with powershell version】
    ise in win7 + powershell 2.0: not support PSWorkflow.
    ise in win7 + powershell 5.0: yes have this bug,tested.
    ise in win8 + powershell 3.0: unknown
    ise in win8.1 + powershell 4.0: yes have this bug,tested.
    ise in win10 10586:yes have this bug,tested.
    ise in win2016 tp5 :yes have this bug,tested.

    【test code】
    at first let font bigest,then test.
    workflow aaa
    {

    inlinescript #<----color wrong
    
    {
    "bbb"
    }

    }

    【how to fix】
    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

    survey  ·  1 comment  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  16. Invoke-DscResource String to Boolean conversion Failure

    Invoking command:

    Invoke-DscResource -Name cDtc -Method Test -Property @{'Name'='Local';'Ensure'='Present';'AuthenticationLevel'='NoAuth';'Status'='Started';'InboundTransactionsEnabled'='True';'OutboundTransactionsEnabled'='True';'RemoteClientAccessEnabled'='True';'RemoteAdministrationAccessEnabled'='False';'XATransactionsEnabled'='True';'LUTransactionsEnabled'='False'} -ModuleName cDtcResource

    Cause PowerShell to fail.

    Convert property 'OutboundTransactionsEnabled' value from type 'STRING' to type 'BOOLEAN' failed
    At line:17, char:2
    Buffer:
    essEnabled = "False";
    };^

    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  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  17. Allow variable input to be passed to import-dscresource

    To keep configurations and composite resources as modular as possible, we should be able to pass an array of module specifications as a parameter.

    Consider the following:

    [Parameter()]

        [System.Collections.Hashtable[]]
    
    $DscResourcesToImport = @(
    @{ModuleName='xPSDesiredStateConfiguration'; ModuleVersion='3.9.0.0'},
    @{ModuleName='xComputerManagement'; ModuleVersion='1.4.0.0'}
    )
    )

    foreach ($Resource in $DscResourcesToImport)
    {
    $ModuleSpec = @{ModuleName="$Resource.ModuleName"; ModuleVersion="$Resource.ModuleVersion"}
    Import-DscResource -ModuleName $ModuleSpec
    }

    This fails with the error: "Arguments must be constant"

    Thanks for considering this.

    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  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  18. BUG: Windows Server 2012 R2 Change in Parameter Evaluation Timing

    I think I have found what I believe is a bug in Windows Server 2012 R2. The exact same PowerShell script and function call works in multiple versions of Windows and Windows Server but fails in 2012 R2. I opened a support case (REG:116050214117070) and they ended up telling me it's expected behavior. I have an extremely hard time believing this. :-)

    In short, I have a custom function for use with the SharePoint Online client-side object model (CSOM). Its purpose is to accept the object which needs to be loaded (like a list object) and then do the steps…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. Please add a way to programmatically collapse 1 region (ONLY ONE!) in a PowerShell script.

    Please add a way to programmatically collapse 1 region (ONLY ONE!) in a PowerShell script. I'd like to deliver a script with a region of dependencies collapsed. I can use dot sourcing to save someone from viewing the script from having to scroll through the function dependencies but it would be nice to be able to deliver the script in 1 file.

    An example of my use case can be found here: http://stackoverflow.com/questions/37835140/collapse-or-toggle-1-region-in-the-powershell-ise?sfb=2

    4 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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  20. New Cmdlet(s) for AG Lease Events

    MSSQL Tiger Team gave a great presentation today about new extended events and properties for troubleshooting AoAG. These improvements rely on AG Lease & X-events. It would be great to have a set of Cmdlets added to the AG modules to return information captured by AG-Lease a few examples:

    Get-AGDiagnosticEvent
    Get-AGLeaseExpired
    Get-AGLeaseSystemComponent

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →

    We will forward the request, but this is really something you want to send to the SQL Server team. They develop the PowerShell cmdlets for SQL. I would recommend that you send this request to the people who gave the presentation, as feedback from the presentation.

  • Don't see your idea?

Feedback and Knowledge Base