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

## Please feel free to provide feedback or file bugs here.

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

• Hot ideas
• Top ideas
• New ideas
• My feedback
1. ## Fix .NET date formatting bug in .ToString()

PS D:\> gcim win32_operatingsystem | % caption
Microsoft Windows Server 2016 Standard

(I tried the respective registry entry and "$ie = new-object -Com InternetExplorer.ApplicationMedium", no better.) (This input box is too small.) After some script statements to log in and navigate to the incoming tickets monitor, I do a$newcalls = $ie.Document.getElementsByName("callid") (This input box is too small.) That's working perfectly fine in PowerShell version 4, but in v5 I get Exception from HRESULT: 0x800A138A At <path>.ps1:89 char:5 +$newcalls = $ie.Document.getElementsByName("callid") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo… 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## very inconsistent drive letter usage Hi there in this case I have to remove and reinstall an OS while booting from usb stick. But this is only one example - it´s not the first time im seeing this behaviour. if (Test-path c:) {Get-Volume -DriveLetter c | Get-Partition | Remove-PartitionAccessPath -AccessPath c:\} In this line the term C is used three times First time as c: (here would be c:\ also possible) Second time as c (neither c: nor c:\ is working here) Third time as c:\ (neither c nor c: is working here) I´m working with variables - this means I have to create 3… 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## 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… 24 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## using module <Module> does not work as expected I have a problem with loading classes from a module. Script is just two lines as following: using module AzureAD class TestClass { [Microsoft.Open.AzureAD.Model.Application] static DoIt() { return$null; } }

If I run this, using .\Script.ps1 I get the following error:
At C:\path\Script.ps1:3 char:20
+ class TestClass { [Microsoft.Open.AzureAD.Model.Application] static D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : TypeNotFound

However, if I run "using module AzureAD" from the command line first and then run the script, it works fine...

What is the difference in running using module from…

1 vote
Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Powershell does not interpret set variables

Powershell has (optionally) replaced cmd as a standard shell in Windows 10.

However it is a pity that Powershell is not able to interpret commands that rely on usage of variables that are defined in "set"

like %computername%, %windir%, %userprofile%, %appdata% etc
etc

There must be way without breaking this.

try issuing a simple

cd %appdata%

in powershell (often used in KB articles), good luck and have fun (or not).

Imho while I could understand limitations this is pretty odd.

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## PS 5 assigning to list value while PS 4 isn´t

Hi!

We recently got WMF 5.1 (KB3191566) that included PS 5.
We then began finding differences in the behavior of PS 5 and PS 4 when running our scripts. The result was different.

We didn´t notice this problem since someone wrapped it in a try catch block... So to recreate this issue/bug I made this script and ran it on one host with PS 5 and one VM host on PS 4.

public class TestClass
{
public System.Collections.Generic.List<System.Int32> listObject { get; set; }
}
"@

[string]$string = "1"$classWithList = New-Object TestClass

$classWithList.listObject =$string

1 vote
Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## [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 "path\to\our\samplescript.psd1" 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… 2 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## 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 Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Can you add some stuff to Get-ClipBoard? I would have liked the default behaviour to be that an array of newline-split strings was returned from Get-ClipBoard. 97 % of the time I end up writing (Get-ClipBoard) -split "\r?\n" | ...... often filtering out empty elements - and that's just boring. In my own version I used -Raw for a string and nothing for an array/list. Of course you can't change that now in the 5.x version (or later, sigh, will this be our doom in some distant future), but can you maybe add at least -AsArray or similar? Make it so it can only be used with… 3 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Make Import-DSCResource dynamic keyword parameter -ModuleVersion mandatory or generate parsing warning Configurations expire when the DSCResource modules they import change. It would be very welcomed if a warning was generated by the pasrser when the Import-DSCResource keyword was used without specifying either the Fully Qualified Module Name (FQMN) or the ModuleVersion parameter/Argument pair. This would simplfy managing different versions of a configuration both on the build server as well consuming blog posts that have you guessing what version of the Module was being used. 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## PS5: Get-Help <anycommand> -ShowWindow doesn't display help When executing "Get-Help <anycommand> -ShowWindow", the resulting window doesn't contain any help text. 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## 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 = "hej",…

1 vote
Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Make the Continue statement work in ForEach-Object

Within in ForEach-Object script block, "continue" behaves like "break", and one should use "return" to simulate "continue". But, from my perspective, it would make sense to give "continue" foreach-object awareness

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Provide a native ternary operator

It would be very nice and convenient if PowerShell had a native ternary operator like C# does (https://msdn.microsoft.com/en-us/library/zakwfxx4(v=vs.100).aspx).

Basically it would allow you to write a short-hand if-else statement, so instead of having to write:

if ($someBoolCondition) {$x = $y.Property1 } else {$x = $y.Property2 } you could just write:$x = $someBoolCondition ?$y.Property1 : $y.Property2 This operator is fairly standard in many programming languages, so it would be awesome if PowerShell could come up to speed with it as well. Thanks. 2 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## PowerShell Core - Workflow Support Workflows in Windows PowerShell are extremely powerful, we've started investigating their use for our user provisioning tasks which need to gracefully handle timing issues, connectivity issues, throttling, etc. We'd really like to be able to run workflows in lightweight configurations like Docker Containers, the Nano Server image is especially attractive as it is so small. Unfortunately PowerShell Core on the Nano Server doesn't currently support workflows, we'd like to see that support added in PowerShell Core. 7 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## 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.

1 vote
Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## ExecutionPolicyOverride-Problem with GPO in place on Server 2016

I'm preparing some "Windows Server 2016" machines. While testing I stumbled across some issues with PowerShell.
I invested some time and narrowed it down a bit.

I also posted the issue on Microsoft Technet Forum and got the recommendation to file a Bug/Request here. Other users were also able to reproduce it quite easily:
(see: https://social.technet.microsoft.com/Forums/en-US/842c2cc2-c7f6-41b7-9561-31b2c65262b0/executionpolicyoverrideproblem-with-gpo-in-place-?forum=winserverpowershell)

Steps to reproduce:

I create a new VM, insert the Server 2016 ISO, boot up and install. After first start I change the network-settings for my environment and join the domain. I move the new computer-object to an OU where the group policy…

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Powershell on Raspberry pi

add Powershell support for Raspberry Pi devices running Raspbian OS

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Bug when loading functions with custom classess from One Drive folder in Windows 10

Check!
(thinking…)
Reset