# 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.
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. ## Remote powershell should not return error for FileSystem validation

SCENARIO
On Machine1:
SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN "Map I drive" /TR "net use I: \someServer\someShare somePassword /user:someDomain\someUser"

On Machine2 run:
$Script = { Write-Output "Hello world!" } Invoke-Command -ComputerName Machine1 -ScriptBlock$Script

As a result you get "Hello world!" but also an error
"Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed."

The error belongs to I drive which should have been returned as a warning and not error. The invoke does not even use the I drive so why fail on it (we in this case dont even want the invoke to have access…

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

## 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 = &quot;continue&quot;$WarningPreference = &quot;continue&quot;
&quot;Begin job&quot;
Write-Verbose &quot;Verbose!&quot;
Write-Warning &quot;Warning!&quot;
&quot;End job&quot;


} -Name "Demo"

$jobs | Wait-Job | Out-Null$jobs | % {

&quot;Result for job &#39;$($_.Name)&#39;&quot;
$_ | Receive-Job -Verbose  }$jobs | Remove-Job | Out-Null

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

3. ## 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:

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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

4. ## 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
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."

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

5. ## [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 6. ## 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&quot; 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 7. ## [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…

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

9. ## 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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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…

10. ## 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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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 12. ## 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.

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

13. ## 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.

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

14. ## 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.

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

15. ## 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 16. ## 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 17. ## 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 Thanks, Martin! I’ll get a bug filed. 18. ## 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 184 votes Sign in (thinking…) Sign in with: Facebook Google Signed in as (Sign out) We’ll send you updates on this idea 19. ## 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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

20. ## 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.

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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