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. Transcript does not log the Verbose and Warning stream of Receive-Job

    Problem

    When we run a job inside a transcript, the Verbose and the Warning streams of the jobs are not displayed in the transcript. However, we can see the in the console correctly.

    Steps to reproduce

    Run the following script
    Start-Transcript -Path 'C:\Logs\DemoJobsTranscriptOutput.txt' -Append | Out-Null

    $VerbosePreference = "continue"
    $WarningPreference = "continue"

    $jobs = @()

    $jobs += Start-Job -ScriptBlock {

    $VerbosePreference = "continue"
    
    $WarningPreference = "continue"
    "Begin job"
    Write-Verbose "Verbose!"
    Write-Warning "Warning!"
    "End job"

    } -Name "Demo"

    $jobs | Wait-Job | Out-Null

    $jobs | % {

    "Result for job '$($_.Name)'"
    
    $_ | Receive-Job -Verbose

    }

    $jobs | Remove-Job | Out-Null

    2 votes
    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 →
  2. We need a proper set of built-in, easy-to-use, dedicated registry cmdlets

    Managing registry keys and values on local and remote systems with PowerShell is a pain.

    Reviewing the articles, forums and blogs on the Internet clearly shows that new PowerShell users struggle to understand how to use registry provider drives and the cmdlets like New-Item, Get-ItemProperty, New-ItemProperty, and so on. This has prompted the creation of a variety of home-brew modules and functions to deal with the problem, like this one, which is extremely useful, but is not built into PowerShell by default of course:

    https://gallery.technet.microsoft.com/RegistryLibrarypsm1-b38a81ba

    PowerShell needs a proper set of built-in, dedicated registry cmdlets that 1) are easy to…

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

    We’ll send you updates on this idea

    4 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  3. Move-Item's -Verbose causes $ErrorActionPreference to be ignored

    Move-Items's -Verbose parameter causes the global $ErrorActionPreference = "Stop" to be ignored. This is a bug. Here's a repro script:

    BugRepro.ps1:

    $ErrorActionPreference = "Stop"
    Write-Host "ErrorActionPreference is $ErrorActionPreference"
    mkdir folder -ErrorAction SilentlyContinue | Out-Null
    "" > a.txt
    Copy-Item a.txt folder
    Write-Host "About to trigger error"
    Move-Item a.txt folder -Verbose | Out-Null
    Write-Host "If you're reading this, then execution didn't stop!"
    Write-Host "Remove the Verbose paramter and it does stop, like it should."

    4 votes
    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 →
  4. [BUG] addition error in assignment operator +=

    [Environment]

    Name Value


    PSVersion 5.1.16299.15
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.16299.15
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1

    [Bug]

    Consider this code:

    [int]$end = 100
    [double]$Increment = 0.1

    1..$End | Foreach-Object {[double]$t += $Increment ; "$_ $t"}

    I'd expect the output always to give the line number and the current total, but look what happens at lines 60 and 101:

    >54 5.4
    >55 5.5
    >56 5.6
    >57 5.7
    >58 5.8
    >59 5.9
    >60 5.99999999999999
    >61 6.09999999999999
    >62 6.19999999999999
    >63 6.29999999999999
    >64 6.39999999999999
    >65 6.49999999999999
    ....
    96 9.59999999999998
    97 9.69999999999998
    98 9.79999999999998
    99 9.89999999999998
    100 9.99999999999998
    101…

    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 →
  5. Command line parsing bug: spaces and trailing slash

    There appears to be a bug parsing arguments to EXEs. If you pass a properly-quoted path that has spaces and a trailing slash, the rest of the command is lumped into the same argument. This also happens if you use a PowerShell variable to hold the path string.

    To repro, first, install EchoArgs.exe (if using chocolatey: cinst -y echoargs). It demonstrates what arguments would get passed to any exe.

    Then run:

    PS> & EchoArgs "C:\spaces and trailing slash" more args

    Echo args shows that it all got lumped into one argument:

    Arg 0 is <C:\spaces and trailing slash" more args>

    6 votes
    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 →
  6. [BUG] Drag and drop to scripts shortcuts split paths containing spaces

    Drag and dropping any file to a script shortcut split this path before passing the splitted strings as multiple parameters. Here's my detailed Issue Report :

    Steps to reproduce

    1 - Get any script, for example :
    [samplescript.psd1] :
    ```
    param([string]$path)

     Write-Host($path)
    
    pause


    or a simpler one-line sample:
    Write-Host($args);pause```

    2 - Create a shortcut that runs the script :
    [Shortcut Target ] : PowerShell &quot;path\to\our\samplescript.psd1&quot;

    3- Drag and drop a file containing spaces in its name to the shortcut
    [sample file ] : C:\Some file with spaces.txt

    Expected behavior

    Drag and dropping the file should pass its path to the…

    4 votes
    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 →
  7. Add ExportTo-Markdown

    Hi

    Using Markdown is common nowadays in VCS tools like Git for readme files.

    Plus it's handy to get a tabular strcture for better visibility.

    Example use cases:
    - Get-Process output comparison at different dates and time
    - SQL query results in tabular form with column names as headers

    So it'd be someInput|ExportTo-MarkDown

    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 →
  8. Out-DataTable

    Creates a DataTable based on an objects properties. Useful for converting any Powershell object into a DataTable which then can be bulk imported into a SQL Server table.

    .EXAMPLE
    $dt = Get-PSDrive | Out-DataTable
    This example creates a DataTable from the properties of Get-Alias and assigns output to $dt variable

    This idea comes from Chad Miller's Out-DataTable: https://gallery.technet.microsoft.com/scriptcenter/4208a159-a52e-4b99-83d4-8048468d29dd#content

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

    We’ll send you updates on this idea

    19 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →

    After much discussion with Aaron Nelson and Chrissy LeMaire, and thanks to the enormous amount of support for this item, we’ve recognized that this is something we need to accomplish, one way or another.

    We don’t want to offer an ETA on this as the work is not well understood by our team yet, and no one currently has immediate bandwidth on starting that investigation. But I want to stress the fact that is an important ask that we’re taking seriously as a priority.

    In the meantime, it would be immensely useful if someone with expertise in the DataTable space could submit an RFC (basically a brief spec) to our PowerShell-RFC repository on GitHub. That way, we can have a discussion about what the design of a ConvertTo-DataTable cmdlet might look like before we dive in on an implementation. The process for doing so is located here: https://github.com/PowerShell/PowerShell-RFC/blob/master/RFC0000-RFC-Process.md#draft

    I…

  9. Write-Host -NoNewLine and Transcription

    Starting with WMF 5.0 the -NoNewLine option for Write-Host is essentially ignored in the transcripts created using Start-Transcript.

    Simple example script:

    Start-Transcript log.txt
    Write-Host -NoNewLine "this should all"
    Write-Host -NoNewLine "be on one line"
    Write-Host -NoNewLine "in the log.txt file"
    Stop-Transcript

    12 votes
    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 →
  10. Start-Process is behaving strange when -credential switch is used

    When running Start-Process start-process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -cred $(Get-Credential) regardless if the credentials differ from the current consoles credentials or the same credentials are used, the new console window seems to be unresponsive, until you switch back to the console from which the new console was launched and start typing something in that console.

    If the same thing is done in ISE, this issue does not occour.

    I have testet this on PS 5.1.14393.206, 5.1.14393.953 and 5.1.14393.693. Windows Server 2012R2, Windows Server 2016 and Windows 10

    Please see the issue in this video: https://goo.gl/8ZvdEV

    4 votes
    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 →
  11. Remote Powershell Session "-ErrorAction Stop" give Non-Terminating Error

    Script with Remote Powershell that are using Try/Catch and (of course) Terminating error, but for some reason under PSv5.1 Shell now those "-ErrorAction Stop" aren’t producing Terminating Error.

    I need to force $ErrorActionPreference = “Stop” to have my Try/Catch to work.

    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 →
  12. Resolve-Path returns null if the file name contains brackets

    To reproduce: Create a file: c:\temp[filename].txt

    $script = Get-ChildItem "C:\Temp[filename].txt"
    Resolve-Path $script

    Error:
    Resolve-Path : Cannot bind argument to parameter 'Path' because it is null.

    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 →
  13. Include UTC timestamp as property to error object

    It'd be very helpful to attach a timestamp of when an error occured to an error object. Open to ideas as to whether it should be UTC, local time, ntp, etc.

    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 →
  14. Catch illegal syntax in array definition

    Today I had an issue where getting an element at a certain index in a typed array failed. As I was troubleshooting this issue I found that it was simply because I had used a '.' (dot) instead of a ',' (comma) to separate the elements when I defined the typed array variable.
    Okay, that is a clear mistake on my part. However, as I thought about it I would have loved to be alerted by the Powershell engine .

    -- Experienced on v5.1.14409.1012 of PowerShell
    
    -- Win7 x64 OS

    TO REPRODUCE:

    open vscode
    
    create ps1 file
    $array = &quot;hej&quot;,
    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 →
  15. Get-Service should return the user account the services are running under

    The Get-Service cmdlet should return the service account associated to each service.

    We can get this information easily from the Win32_Service WMI class, but to me, it should be returned by Get-Service.

    Checked with PS v5 without luck...

    Thanks!

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

    We’ll send you updates on this idea

    7 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  16. No StdOut output on console until second object

    Let me explain. I have a script that is collecting data, and I send it to StdOut by simply piping it into Select (but problem also happens if I add a ForEach loop and simply make [PSCustomObject] objects). Then my script loops to the next server. That output is not displaying on the screen. All is not lost though, when the script loops to the second server and displays both the first and second will now display. When the third server finishes it displays OK, as does the 4th.

    So it looks like it's just the first one. Normally I…

    6 votes
    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 →
  17. Out of the box support for YAML like csv / xml / json

    Votes from Connect: 25

    Original Date Submitted: 4/16/2015 7:34:07 PM

    Description:
    Contact Information
    Handle: ducke
    Site Name: PowerShell
    Feedback ID: 1252364


    Problem Description:
    In the "DevOps" world, YAML is a first class citizien in products like Kitchen CI, Elasticsearch, Appveyor, Travis CI, rubocop etc.
    It would be great to have commands similar to https://github.com/dfinke/PowerYaml native without the need to import a module.

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

    Repro Steps:

    Internal BugId: 14385

    181 votes
    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 →
  18. Allow to be cast Dictionary type with [pscustomobject]

    $d = New-Object 'system.collections.generic.dictionary[string,string]'
    $d.Add("a","1")
    $d.Add("b","2")

    PS > [pscustomobject]$d

    Key Value


    a 1
    b 2

    Preferred output should be:

    PS > New-Object PsObject -Property $d

    a b
    - -
    1 2

    PS > [pscustomobject]@{a=1;b=2}

    a b
    - -
    1 2

    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 →
  19. Version Numbering for All Releases

    Please increment the version number for ALL releases, indicate which ones are supported in production, and provide a Get-PSVersionInfo cmdlet as described in http://powershell.org/wp/?p=33342.

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

    We’ll send you updates on this idea

    10 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →

    Hi everyone,

    With PowerShell 6.0, we’ve already begun updating our versioning system to be more descriptive. Right now, PSVersion returns 6.0.0-alpha as a System.Management.Automation.SemanticVersion object (with Major, Minor, Patch, and Label properties), and we’ve also added a GitCommitId property to PSVersionTable that matches perfectly with tags on GitHub: https://github.com/powershell/powershell/tags

    Still, we can definitely continue to improve the semantic version implementation. You can track (and contribute to!) the discussion on these improvements here: https://github.com/PowerShell/PowerShell/issues/2354

    Thanks,
    Joey

  20. Bug in Show-Command

    Scriptblock parameters are interpreted as a [bool] value and is shown as a listbox with values $true or $false

    Code to reproduce:

    Show-Command -Name Invoke-Command

    Scriptblock parameter is shown as a [bool] listbox

    Cheers

    Tore

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

Feedback and Knowledge Base