# 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

PS D:\> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 1 14393 1358 PS D:\> [DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss') 2017-07-27 12.29.37 8 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 • ## [BUG] Cannot import both PSDesiredStateConfiguration in-box module and PSDscResources (gallery module) in the same configuration OS: Windows Server 2016 1607 (14393.1593) PSVersionTable: Name Value ---- ----- PSVersion 5.1.14393.1532 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.1532 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 PSDscResource module: v2.8.0.0 Take a look at this configuration: Configuration DependentConfig { Import-DscResource -ModuleName PSDscResources -Name Registry Node MyNode01 { File SetupScript { DestinationPath = 'C:\Scripts\hello.txt' Contents = 'somecommand' Type = 'File' Ensure = 'Present' DependsOn = '[Registry]regCheck' } Registry regCheck { Key = 'HKEY_LOCAL_MACHINE\SYSTEM\SomeKey' ValueName = 'SomeValue' ValueData = 0 ValueType = 'DWord' Ensure = 'Present' } } } DependentConfig -OutputPath C:\DependentConfig This requires PSDscResources module version 2.8.0.0 from… 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 • ## [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…

Check!
(thinking…)
Reset
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…

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

We’ll send you updates on this idea

• ## update-help : Failed to update Help for the module(s) 'Provisioning'

I receive the following error when running Update-Help in PowerShell.

PS C:\WINDOWS\System32\WindowsPowerShell\v1.0\Modules\Provisioning> update-help
update-help : Failed to update Help for the module(s) 'Provisioning' with UI culture(s) {en-US} : Unable to retrieve
the HelpInfo XML file for UI culture en-US. Make sure the HelpInfoUri property in the module manifest is valid or
check your network connection and then try the command again.
At line:1 char:1
+ update-help -force
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Update-Help], Exception
+ FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand

PowerShell info:
PS C:\> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 1 15063 138 23 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 passed this on to the documentation team, thanks. • ## Get-Credential does not support Smart Card user name hints If you utilize Smart Cards with certificates that are not directly linked to users (no suitable user DN in Subject and no UPNs in SANs), you are able to link a single certificate to multiple accounts dynamically with the caveat that users need to provide explicit user name hints during logon in order to log on. User name hints need to be enabled via GPO or registry settings ("X509HintsNeeded"), after which all standard credential dialogs in Windows support them, except PowerShell's Get-Credential. This effectively prevents using PowerShell remoting with such Smart Cards / certificates if different credentials are required. In… 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 • ## 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 Please respect your own system variables in use for decades Microsoft. Thank you a lot. 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. 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 • ## 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 • ## Composite DSC Resources DependOn Bug? Composite Resources DependsOn Bug? Bumped into this URL and it seems I'm experiencing the same issue with composite resources DependsOn: https://powershell.org/forums/topic/composite-resource-dependson-bug/ >$psversiontable

Name Value
---- -----
PSVersion 5.1.15063.502
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.502
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

1 vote
Check!
(thinking…)
Reset
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>

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

We’ll send you updates on this idea

• ## Out-GridView should not leave a trailing tab character when ctrl+c is used with only one data row present.

I wrote a script that takes a MAC address in any common format as input and outputs it to all other standard MAC formats. This is all in a single row of data and is meant to be a convenient tool for working between systems that use different formats of MACs without having to constantly reformat them by hand. However, when copying the output from the gridview a trailing tab is placed at the end of the MAC even though there is only a single row in the view and no tabs in the original text. It's like it is…

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

We’ll send you updates on this idea

• ## Bug in New-FileCatalog

This bug also applies to Test-FileCatalog, I believe.

Create a script containing the following commands, and run it with the -Verbose switch

----------------------------------------------------------

[CmdletBinding()]

param ( $path = 'SOMEPATHOROTHER' New-FileCatalog -Path$path -CatalogFilePath C:\Source.cat -CatalogVersion 2.0
New-FileCatalog -Path $path -CatalogFilePath C:\Destination.cat -CatalogVersion 2.0 ---------------------------------------------------------- The output will contain VERBOSE output, even though the script does not contain any Write-Verbose commands. 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 • ## Pure Pain: Preinstalled PS Modules - Please Rationalize Them with Package Management Installs I am trying to update Pester on Windows 2016 to 4.x because the preshipped Pester 3.4.0 emits a note about the depreciation of the -quiet switch when I use the quiet switch. This get's scooped into stdout when executing via AWS SSM remote commands. Version 3.x complains it does not understand "-Show None". I want to update to 4.x - in which I ran into all the problems documented here: https://github.com/OneGet/oneget/issues/215 But ended up with "Install-module pester -force -SkipPublisherCheck. So far so bad, but when I go to remove the 3.4.0 version (with admin rights) from: 'c:\program files\windowspowershell\modules\pester\3.4.0' I get… 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 The issues you have encountered can be frustrating, sorry that is the case for you. Moving this to Survey to try to gauge the scope of the problem for users generally. We are somewhat limited by security requirements: what ships with Windows will always be tagged so that nothing can replace it easily unless it is signed by Microsoft. While Pester is part of Windows, it is not owned or developed by Microsoft, so updates delivered via the Gallery cannot be Microsoft signed. Once the Gallery version is installed on a system, -SkipPublisherCheck is no longer required for future updates. That first experience, however, is bad. This leaves us with a dilemma: do we stop shipping Pester in with PowerShell in the future, or do we continue to provide the feature set knowing users who update from the Gallery will encounter these issues? Looking for feedback from as many users… • ## [BUG] Configuration enact fails when resource instances of same type have different PSDscRunAsCredentials Take a look at the following configuration:$configurationData =
@{
AllNodes =
@(
@{
NodeName = 'S16-01'
PsDscAllowPlainTextPassword = $true PSDscAllowDomainUser =$true
}
)
}

Configuration DSCRunDemo
{
param (
[pscredential] $Credential ) Import-DscResource -ModuleName PSDesiredStateConfiguration Node$AllNodes.NodeName
{
Script DSCRunDemo1
{
SetScript =
{
Write-Verbose -Message $(whoami) } TestScript = { return$false
}
GetScript =
{
return @{}
}
PsDscRunAsCredential = $Credential } Script DSCRunDemo2 { SetScript = { Write-Verbose -Message$(whoami)
}
TestScript =
{
return $false } GetScript = { return @{} } } } } DSCRunDemo -ConfigurationData$configurationData -Credential (Get-Credential)

One instance of the…

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

We’ll send you updates on this idea

• ## xcertificateimport

When using the interactive Windows Certificates snap-in, a 3rd very important cert target store type can be selected:
One can select "my user account", "computer account" and "service account" as target for certificates.

xCertificateImport currently seems to only support 2 target store types:
Location: 'LocalMachine' or 'CurrentUser'

As an admin it would be very cool to be able to also use xCertificateImport to also manage service-related certificates, as there are otherwise no PowerShell means to do so and the GUI cert tool is a PITA, as its not scriptable. And there are Microsoft own services out there that needs such…

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

We’ll send you updates on this idea

• ## PSCore6 compatibility

I started testing Powershell from https://github.com/PowerShell/PowerShell and https://hub.docker.com/r/microsoft/powershell/

Sadly, it appears a lot of modules for Windows Management like ActiveDirectory, MsOnline, Azure are not working there because implemented as PSSnapIn.

Having PSCore6 compatible module published publicly would be great!

Thanks

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

We’ll send you updates on this idea

• ## [BUG]New-PSDrive FileSystem does not work for Backup-SqlDatabase

The -BackupFile parameter for the Backup-SqlDatabase cmdlet does not work properly with a drive created with the New-PSDrive cmdlet. It will first pull the default backup drive for the SQL Server then append the string for the file system. For example:

New-PSDrive -Name "fs" -PSProvider FileSystem -Root "\\MyFileServer\Backups"
Backup-SqlDatabase -Database "MyDatabase" -ServerInstance "MySQLServer" -BackupFile "fs:\MyDatabase.bak"

Would error with "Cannot find the path 'C:\BackupPath\fs:\MyDatabase.bak'"

1 vote
Check!
(thinking…)
Reset
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

• ## PowerShell Classes should allow properties with get and set

PowerShell classes should more closely mirror the abilities of a C# class imported and allow full differentiation between fields and properties. Properties should allow getter and setter code blocks

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

We’ll send you updates on this idea

• ## BUG: GetMetaConfiguration should validate property values against allowed values of MSFT_DSCMetaConfiguration CIM Properties

Once a node meta configuration is enacted, it is easy for an administrator or process (with malicious intent) to modify the MetaConfig.mof file in C:\Windows\System32\Configuration directory. The GetMetaConfiguration method in MSFT_DscMetaConfiguration class does not validate the property values against the allowed values of the CIM properties.

Steps to reproduce this behavior:
- Enact a simple meta configuration and enact it.
- Open the MetaConfig.MOF file in your favorite editor and change the value of ConfigurationMode to some random text.
- Save the file and close it.
- Run Get-DscLocalConfigurationManager.
- You will see the random value assigned to ConfigurationMode in…

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

We’ll send you updates on this idea

Ravikanth,

We have validated this issue and created two bugs for it.

1. We will validate the MOF when it is passed in as part of our API (i.e. Set-DscLocalConfigurationManager) and error if the values are not valid.
2. We will write a warning when Get-DscLocalConfigurationManager reads a MOF that has invalid values and at LCM startup. The resultant behavior will behave like it does today where invalid values will be read as the default value by the LCM.