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. Classes do not support data hiding.

I am grateful for the addition of classes in PS, and I know why PowerShell classes do not support true data hiding, but it is a significant shortcoming. It does not allow full control of setting a property for example. I can write my own class method for setting it, but it can be changed outside of that method. And if that method also updates the value of another class property, it can get changed directly, without going through the desired logic so the class method can be bypassed.
And it is nice to have the get and set automatically…

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

2. PowerShell StackOverFlowException: get-childitem -path HKLM:\ -recurse -include *Windows*

PowerShell has a bug in it which causes a "StackOverFlowException" when running the following command:
get-childitem -path HKLM:\ -recurse -include Windows

It was originally reproduced while looking for something different than:
Windows

This is consistently reproducible in latest updates applied of Windows 10 x64 Business and Home, with both PowerShell.exe, and ISE, x86 and standard.

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… 2 votes Sign in (thinking…) Sign in with: Facebook Google Signed in as (Sign out) We’ll send you updates on this idea 5. 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 = &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 2 votes Sign in (thinking…) Sign in with: Facebook Google Signed in as (Sign out) We’ll send you updates on this idea 6. 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… 30 votes Sign in (thinking…) Sign in with: Facebook Google Signed in as (Sign out) We’ll send you updates on this idea 7. 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." 5 votes Sign in (thinking…) Sign in with: Facebook Google Signed in as (Sign out) We’ll send you updates on this idea 8. [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
(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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


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 204 votes Sign in (thinking…) Sign in with: Facebook Google 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… 13. 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 14. 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

(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

15. 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.

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 17. 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 18. 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! 186 votes Sign in (thinking…) Sign in with: Facebook Google Signed in as (Sign out) We’ll send you updates on this idea 19. 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
(thinking…)
Signed in as (Sign out)

We’ll send you updates on this idea

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